Click here to Skip to main content
14,427,747 members
   

C#

 
AnswerRe: how to check if value exists in database from textbox c# Pin
#realJSOP27-Nov-19 1:55
mva#realJSOP27-Nov-19 1:55 
AnswerRe: how to check if value exists in database from textbox c# Pin
Gerry Schmitz27-Nov-19 8:15
mveGerry Schmitz27-Nov-19 8:15 
AnswerRe: how to check if value exists in database from textbox c# Pin
Shraddha_Patel16-Dec-19 23:30
MemberShraddha_Patel16-Dec-19 23:30 
Questionplotting a point graph for a continuous real time data in c# windows form application Pin
Member 1465244924-Nov-19 23:48
MemberMember 1465244924-Nov-19 23:48 
QuestionRe: plotting a point graph for a continuous real time data in c# windows form application Pin
Richard MacCutchan25-Nov-19 0:16
communityengineerRichard MacCutchan25-Nov-19 0:16 
AnswerRe: plotting a point graph for a continuous real time data in c# windows form application Pin
Member 1465244925-Nov-19 1:28
MemberMember 1465244925-Nov-19 1:28 
GeneralRe: plotting a point graph for a continuous real time data in c# windows form application Pin
Richard MacCutchan25-Nov-19 2:04
communityengineerRichard MacCutchan25-Nov-19 2:04 
QuestionNeed Help With Syntax Pin
Kevin Marois23-Nov-19 11:01
professionalKevin Marois23-Nov-19 11:01 
I have this code in my DAL:
public async Task<IList<CompanyHeaderEntity>> GetCompanyHeadersAsync()
{
    var t = await Task.Factory.StartNew(() =>
    {
        List<CompanyHeaderEntity> results = new List<CompanyHeaderEntity>();

        using (var db = GetDataContext())
        {
            try
            {
                results = (from c in db.Companies
                            where !c.DeletedDT.HasValue
                            select new CompanyHeaderEntity
                            {
                                Id = c.Id,
                                CompanyName = c.CompanyName
                            }).OrderBy(x => x.CompanyName).ToList();
            }
            catch (Exception e)
            {
                throw;
            }

            return results;
        }
    });

    return t;
}
What I'd like to do is pass in a delegate, so that I could say "Give me all Companies where [whatever]." But in all cases, I want to include the WHERE clause I already have in there.
where !c.DeletedDT.HasValue
So I somehow need to append the deleted check to whatever I pass in.

What's the right way to do this?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: Need Help With Syntax Pin
phil.o23-Nov-19 11:25
mvephil.o23-Nov-19 11:25 
GeneralRe: Need Help With Syntax Pin
Kevin Marois23-Nov-19 11:40
professionalKevin Marois23-Nov-19 11:40 
GeneralRe: Need Help With Syntax Pin
Kevin Marois23-Nov-19 11:58
professionalKevin Marois23-Nov-19 11:58 
GeneralRe: Need Help With Syntax Pin
phil.o23-Nov-19 12:29
mvephil.o23-Nov-19 12:29 
RantRe: Need Help With Syntax Pin
Kevin Marois23-Nov-19 13:26
professionalKevin Marois23-Nov-19 13:26 
GeneralRe: Need Help With Syntax Pin
phil.o23-Nov-19 13:45
mvephil.o23-Nov-19 13:45 
QuestionDeleting textbox created dynamically, using delete key, while there are more than 1 textbox that have been dragged and dropped on a picture box. Pin
Member 443266022-Nov-19 2:14
MemberMember 443266022-Nov-19 2:14 
AnswerRe: Deleting textbox created dynamically, using delete key, while there are more than 1 textbox that have been dragged and dropped on a picture box. Pin
OriginalGriff22-Nov-19 2:31
communityengineerOriginalGriff22-Nov-19 2:31 
GeneralRe: Deleting textbox created dynamically, using delete key, while there are more than 1 textbox that have been dragged and dropped on a picture box. Pin
Member 443266023-Nov-19 4:07
MemberMember 443266023-Nov-19 4:07 
GeneralRe: Deleting textbox created dynamically, using delete key, while there are more than 1 textbox that have been dragged and dropped on a picture box. Pin
OriginalGriff23-Nov-19 5:00
communityengineerOriginalGriff23-Nov-19 5:00 
GeneralRe: Deleting textbox created dynamically, using delete key, while there are more than 1 textbox that have been dragged and dropped on a picture box. Pin
Member 443266023-Nov-19 20:16
MemberMember 443266023-Nov-19 20:16 
QuestionDifferences of 3 libraries in voice programming ? Pin
Member 245846721-Nov-19 16:55
MemberMember 245846721-Nov-19 16:55 
AnswerRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan21-Nov-19 22:33
communityengineerRichard MacCutchan21-Nov-19 22:33 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
OriginalGriff21-Nov-19 23:51
communityengineerOriginalGriff21-Nov-19 23:51 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan22-Nov-19 0:05
communityengineerRichard MacCutchan22-Nov-19 0:05 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
phil.o22-Nov-19 8:03
mvephil.o22-Nov-19 8:03 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Member 245846724-Nov-19 15:25
MemberMember 245846724-Nov-19 15:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.