I‘ve been working on a query using LINQ but I’ve run into a snag with a dynamic where clause. I want to check for a condition and if true then add that where to my query.
Use IQueryable here is more info why link
IQueryable<{CreateNewSelectObjects}> query = ... ; if (sProjType != null) { query = query.Where(x => x.TypeDesc==sProjType); }