public async Task <Customer> Add(Customer customer) { var entity = _context.Add(customer).Entity; await _context.SaveChangesAsync(); return(entity); }
public async Task <IActionResult> Create([Bind("LocationId,LocationName")] Location location) { if (ModelState.IsValid) { _context.Add(location); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(location)); }