public IActionResult GetById(int id) { _context.GetCustomerById(id); if (_context.GetCustomerById(id) == null) { return(BadRequest()); } else { return(Ok(_context.GetCustomerById(id))); } }
public IActionResult Edit(int?id) { if (id == null) { return(NotFound()); } Customer customer = context.GetCustomerById(id); if (customer == null) { return(NotFound()); } return(View(customer)); }