コード例 #1
0
 public IActionResult GetAllCustomers()
 {
     try
     {
         return(Ok(_mapper.ParseCustomer(_customerService.GetAllCustomers())));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
コード例 #2
0
 public Model.Customer AddCustomer(Model.Customer newCustomer)
 {
     _context.Customers.Add(_mapper.ParseCustomer(newCustomer));
     _context.SaveChanges();
     return(newCustomer);
 }