I am working on MVC application, there I am trying to update one table during edit operation. I am getting the following error.
Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
I searched no clue. Here is my code, any help please?
var hoteling = context.Hoteling.FirstOrDefault(h => h.HotelingId == modelData.HotelingId);
if (hoteling != null)
{
hoteling.BookedBy = (string)Session["UserName"];
hoteling.BookingType = Convert.ToInt32(modelData.BookingType);
hoteling.Description = modelData.Description;
hoteling.StartDate = modelData.StartDate;
hoteling.EndDate = modelData.EndDate;
hoteling.StartTime = modelData.StartTime;
hoteling.EndTime = modelData.EndTime;
hoteling.WorkSpaceRefId = modelData.WorkSpaceRefId;
hoteling.ProjectId = 1;
hoteling.RepeatDay = modelData.RepeatDay;
hoteling.RepeatType = modelData.RepeatType;
context.SaveChanges();
}