public void InsertOrUpdate(CASOS_USOS casos_usos)
 {
     if (casos_usos.ID == default(decimal)) {
         // New entity
         context.CASOS_USOS.Add(casos_usos);
     } else {
         // Existing entity
         context.Entry(casos_usos).State = EntityState.Modified;
     }
 }
 public ActionResult Create(CASOS_USOS casos_usos)
 {
     if (ModelState.IsValid) {
         casos_usosRepository.InsertOrUpdate(casos_usos);
         casos_usosRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }