Click below for Step by Step and Interview Q & A (dotnetinter) wrote,
Click below for Step by Step and Interview Q & A

How can we handle concurrency in Entity framework? ( .NET Entity framework interview questions)

Before this the interviewer can ask you what is concurrency ?. You can read about concurrency from

In EF concurrency issue is resolved by using optimistic locking. Please refer ADO.NET chapter for what is optimistic locking and pessimistic locking?. To implement optimistic locking right click on the EDMX designer and set the concurrency mode to “Fixed” as shown in the below figure.


Now whenever we have concurrency issues you should get “OptimisticConcurrencyException” error as shown in the below figure. You can then put a try / catch  to handle this situation.

Below is a great ADO.NET Entity framework interview question video created by which shows how to do CRUD using Entity framework.

Tags: c# entity framework interview questions, concurrency interview questions, csharp interview questions, information technology questions, optimistic and pessimistic locking inter, programming interview questions

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded