public ActionResult Edit(Personal personal)
 {
     if (ModelState.IsValid) {
         unitOfWork.PersonalRepository.InsertOrUpdate(personal);
         unitOfWork.PersonalRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
 public void InsertOrUpdate(Personal personal)
 {
     if (personal.Id == default(System.Guid)) {
         // New entity
         personal.Id = Guid.NewGuid();
         context.Personals.Add(personal);
     } else {
         // Existing entity
         context.Entry(personal).State = EntityState.Modified;
     }
 }