I am facing below error when i Update Data.
Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
public ActionResult DeleteUserType(UserTypeMV usertypemv)
{
if (string.IsNullOrEmpty(Convert.ToString(Session["UserName"])))
{
RedirectToAction("Login", "Home");
}
var userid = 0;
var usertypeid = 0;
int.TryParse(Convert.ToString(Session["UserID"]), out userid);
int.TryParse(Convert.ToString(Session["usertypeid"]), out usertypeid);
if (usertypeid != 1)
{
return RedirectToAction("Admin", "DashBoard");
}
var deleteusertype = new tblUserType();
deleteusertype.UserTypeID = usertypemv.UserTypeID;
usertypemv.UserType = deleteusertype.UserType;
usertypemv.Designation = deleteusertype.Designation;
deleteusertype.Del_ID = 1;
DB.Entry(deleteusertype).State = System.Data.Entity.EntityState.Modified;
DB.SaveChanges();
return RedirectToAction("AllUserTypes");
}