public IActionResult Create(Band band) { using (var db = new BandRegisterDbContext()) { db.Add(band); db.SaveChanges(); } return(RedirectToAction("Index")); }
public IActionResult Create(string name, string members, double honorarium, string genre) { Band newBand = new Band { Name = name, Members = members, Honorarium = honorarium, Genre = genre }; using (var db = new BandRegisterDbContext()) { db.Add(newBand); db.SaveChanges(); } return(RedirectToAction("Index")); }