0

I'm using ASP.NET Core with Entity Framework.

I have found this working command on Stackoverflow

var d = await db.Employee.Where(x => x.FirstName == "Jack").ToListAsync();

at the following link : Entity Framework - async select with where condition

Please tell me how can I load the table records into a list based on multiple where conditions.

I want something like that :

var d = await db.Employee.Where(x => x.LastName == "Smith" 
                                     and x => x.Country == "UK" 
                                     and x => x.Age == 45 etc)

1 Answer 1

2

You are almost there

var d = await db.Employee.Where(x => x.LastName == "Smith" 
                          && x.Country == "UK"
                           && x.Age == 45)
                          .ToListAsync();
Sign up to request clarification or add additional context in comments.

2 Comments

It is working ! Thank you very much !
You are welcome!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.