public IActionResult Create(Item product) { if (ModelState.IsValid) { try{ _dbContext.Items.Add(product); _dbContext.SaveChanges(); } catch {} } return(RedirectToAction("Index")); }
public Town Add(Town town) { context.Towns.Add(town); context.SaveChanges(); return(town); }
public Employee Add(Employee employee) { context.Employees.Add(employee); context.SaveChanges(); return(employee); }