I have a asp.net mvc project which uses Entity Framework 6.The index page fetches records in a gridMVC. I have an add a new record button on top to add new record which opens up in a bootstrap modal popup. Everything works fine till the user tries to enter duplicate records. Below is the code where I have done exception handling that whenever the adding fails, it should throw an exception which will display an alert box to user to notify him about adding duplicate records.I have a asp.net mvc project which uses Entity