KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a LINQ query that looks like the following: DateTime today = DateTime.UtcNow; var results = from order in context.Orders where ((order.OrderDate <= today) && (today <= order.OrderDate)) select order; I am trying to learn / understand LINQ. In some cases, I need to add two additional WHERE clauses. In an effort to do this, I'm using: if (useAdditionalClauses) { results = results.Where(o => o.OrderStatus == OrderStatus.Open) // Now I'm stuck. } As you can see, I know how to add an additional WHERE clause. But how do I add multiple? For instance, I'd like to add WHERE o.OrderStatus == OrderStatus.Open AND o.CustomerID == customerID to my previous query. How do I do this using extension methods? Thank you!
Tags (comma-separated)
Save Edits
Cancel