I want to delete multiple records in entity framework without using a for loop or any other loop using LINQ. Something that we can do it in SQL is there any way to delete multiple records in entity framework?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you want to do is not supported using Entity Framework. Entity Framework needs to load an object into memory, before you can delete it. This way it can do its optimistic concurrency checks.
If you really need this, you will have to do this with pure SQL or better, use a stored procedure. You can call your stored procedure with Entity Framework.