This question is locked. New answers and comments are not allowed.
hello
I have telerik grid whose model is having PK which is user entered value. Update Action method is as follows.
When record is updated, it shows PK field also as PK field value is user entered. So, if user edit record by entering already existing value in PK field, it is not throwing exception Dbupdateexception. Is there any problem in this?
How can I solve this?
I have telerik grid whose model is having PK which is user entered value. Update Action method is as follows.
public ActionResult Update_Magazine(string magtype, string lang, string region) { var repost = context.Magazines.FirstOrDefault(r => r.MAGAZINE_TYPE == magtype); if (repost != null) { repost.MAGAZINE_LANG = lang; repost.MAGAZINE_REGION = region; repost.MODIFIED_BY = 1; repost.MODIFIED_DATE = DateTime.Now; TryUpdateModel(repost); context.SaveChanges(); } return View(new GridModel(context.Magazines)); }When record is updated, it shows PK field also as PK field value is user entered. So, if user edit record by entering already existing value in PK field, it is not throwing exception Dbupdateexception. Is there any problem in this?
How can I solve this?