Answers for "how to write where condition in linq morethan two"

C#
0

linq query two conditions

on new { t1.ProjectID, SecondProperty = true } equals 
   new { t2.ProjectID, SecondProperty = t2.Completed } into j1
   
from t1 in Projects
from t2 in Tasks.Where(x => t1.ProjectID == x.ProjectID && x.Completed == true)
                .DefaultIfEmpty()
select new { t1.ProjectName, t2.TaskName }
Posted by: Guest on July-09-2021
0

Using more than one condition in linq's where method

codebase.Methods.Where(x => (x.Body.Scopes.Count > 5) && (x.Foo == "test"));
Posted by: Guest on September-24-2021

C# Answers by Framework

Browse Popular Code Answers by Language