Check duplicaiton before inserting in Database using Entity Framework in ASP.Net MVC

nauna
 
on May 23, 2019 05:35 AM
3485 Views

hello,

i am using this insert in linQ mvc i want to check duplicate before insert so if value already exists so it should return messages that already exist please advice

 if (ModelState.IsValid)
{
    db.users.Add(SU);
    db.SaveChanges();

}

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download