public IActionResult UpdateOne(Fric_frac.Models.FricFrac.Eventcategory eventCategory) { if (ModelState.IsValid) { try { dbContext.Update(eventCategory); dbContext.SaveChanges(); ViewBag.EventCategories = dbContext.Eventcategory.ToList(); return(View("ReadingOne", eventCategory)); } catch (DbUpdateConcurrencyException) { if (!dbContext.Eventcategory.Any(e => e.Id == eventCategory.Id)) { return(NotFound()); } else { throw; } } } return(View("Index", eventCategory)); }
public IActionResult InsertOne(Fric_frac.Models.FricFrac.Eventcategory eventCategory) { ViewBag.Message = "Fric-frac EventCategory Inserting One"; dbContext.Eventcategory.Add(eventCategory); dbContext.SaveChanges(); return(View("Index", dbContext.Eventcategory.ToList())); }