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(); }
Hi nauna,
Refer below links -
https://stackoverflow.com/questions/1802286/best-way-to-check-if-object-exists-in-entity-framework
https://stackoverflow.com/questions/9287454/check-the-existence-of-a-record-before-inserting-a-new-record
https://stackoverflow.com/questions/9603131/where-to-run-a-duplicate-check-for-an-entity
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.