Click here to Skip to main content
15,896,444 members
Home / Discussions / C#
   

C#

 
AnswerRe: Advices for my learning path Pin
Richard Andrew x648-Jul-23 3:26
professionalRichard Andrew x648-Jul-23 3:26 
GeneralRe: Advices for my learning path Pin
coco2439-Jul-23 9:07
coco2439-Jul-23 9:07 
GeneralRe: Advices for my learning path Pin
jschell10-Jul-23 3:50
jschell10-Jul-23 3:50 
AnswerRe: Advices for my learning path Pin
BillWoodruff9-Jul-23 15:06
professionalBillWoodruff9-Jul-23 15:06 
GeneralRe: Advices for my learning path Pin
coco24310-Jul-23 18:34
coco24310-Jul-23 18:34 
GeneralRe: Advices for my learning path Pin
BillWoodruff10-Jul-23 18:58
professionalBillWoodruff10-Jul-23 18:58 
GeneralRe: Advices for my learning path Pin
Richard MacCutchan10-Jul-23 21:55
mveRichard MacCutchan10-Jul-23 21:55 
AnswerRe: Advices for my learning path Pin
Gerry Schmitz18-Jul-23 6:03
mveGerry Schmitz18-Jul-23 6:03 
GeneralRe: Advices for my learning path Pin
coco24319-Jul-23 18:36
coco24319-Jul-23 18:36 
QuestionGoogle People API Error Pin
Kevin Marois6-Jul-23 10:54
professionalKevin Marois6-Jul-23 10:54 
AnswerRe: Google People API Error Pin
OriginalGriff6-Jul-23 18:30
mveOriginalGriff6-Jul-23 18:30 
GeneralRe: Google People API Error Pin
Kevin Marois7-Jul-23 6:26
professionalKevin Marois7-Jul-23 6:26 
GeneralRe: Google People API Error Pin
OriginalGriff7-Jul-23 6:45
mveOriginalGriff7-Jul-23 6:45 
Questionwhy the data been sent out after socket.close(), not socket.send(). Pin
viming4-Jul-23 16:06
viming4-Jul-23 16:06 
AnswerRe: why the data been sent out after socket.close(), not socket.send(). Pin
OriginalGriff4-Jul-23 18:19
mveOriginalGriff4-Jul-23 18:19 
GeneralRe: why the data been sent out after socket.close(), not socket.send(). Pin
viming4-Jul-23 21:05
viming4-Jul-23 21:05 
GeneralRe: why the data been sent out after socket.close(), not socket.send(). Pin
OriginalGriff4-Jul-23 21:14
mveOriginalGriff4-Jul-23 21:14 
AnswerRe: why the data been sent out after socket.close(), not socket.send(). Pin
jschell5-Jul-23 5:26
jschell5-Jul-23 5:26 
QuestionProblem with string array? Pin
Member 140558794-Jul-23 6:28
Member 140558794-Jul-23 6:28 
AnswerRe: Problem with string array? Pin
Dave Kreskowiak4-Jul-23 7:06
mveDave Kreskowiak4-Jul-23 7:06 
AnswerRe: Problem with string array? Pin
OriginalGriff4-Jul-23 18:21
mveOriginalGriff4-Jul-23 18:21 
GeneralRe: Problem with string array? Pin
jschell5-Jul-23 5:28
jschell5-Jul-23 5:28 
QuestionPredicateBuilder Question Pin
Kevin Marois30-Jun-23 8:54
professionalKevin Marois30-Jun-23 8:54 
I'm using the predicate builder like this:
// Go through each assignment row
foreach (var vendorAssignment in vendorAssignments)
{
    // Define the query parameters for the job
    var jobPredicate = PredicateBuilder.New<Job>();
    jobPredicate = jobPredicate.And(x => x.AppCompanyId == 1);
    jobPredicate = jobPredicate.And(x => !x.DeletedDT.HasValue);
    jobPredicate = jobPredicate.And(x => x.Id == vendorAssignment.ParentId); 

    // Get the job
    var job = (from j in dc.Jobs
                select j).Where(jobPredicate).FirstOrDefault();
}
Do I need to redefine the PredicateBuilder for each loop iteration? Or is it possible to somehow do this?
// Define the query parameters for the job
var jobPredicate = PredicateBuilder.New<Job>();
jobPredicate = jobPredicate.And(x => x.AppCompanyId == 1);
jobPredicate = jobPredicate.And(x => !x.DeletedDT.HasValue);

// Go through each assignment row
foreach (var vendorAssignment in vendorAssignments)
{
    // Add the job id to the query
    jobPredicate = jobPredicate.And(x => x.Id == vendorAssignment.ParentId); // < =====  WON'T THIS JUST KEEP ADDING JOB ID's TO THE QUERY?

    // Get the job
    var job = (from j in dc.Jobs
                select j).Where(jobPredicate).FirstOrDefault();
}
Is there some way to remove the job part somehow?
In theory, theory and practice are the same. But in practice, they never are.”
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.

AnswerRe: PredicateBuilder Question Pin
Dave Kreskowiak1-Jul-23 4:23
mveDave Kreskowiak1-Jul-23 4:23 
GeneralRe: PredicateBuilder Question Pin
Kevin Marois1-Jul-23 8:21
professionalKevin Marois1-Jul-23 8:21 

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.