Example #1
0
 public IActionResult UpdateCustomer(Customer customer, int id)
 {
     if (customer.first_name == "" || customer.last_name == "")
     {
         string message = "You need to fill out both first and last name fields, before submitting the form.";
         return(BadRequest(message));
     }
     return(Ok(_storage.UpdateCustomer(customer, id)));
 }
        public IActionResult UpdateCustomer(Customer newCustomer)
        {
            var success = _customers.UpdateCustomer(newCustomer);

            if (success)
            {
                return(Ok());
            }
            else
            {
                return(BadRequest());
            }
        }
Example #3
0
 public IActionResult UpdateCustomer(Customers customer, int Id)
 {
     return(Ok(_storage.UpdateCustomer(customer, Id)));
 }
        public IActionResult UpdateCustomer(int id, Customers customer)
        {
            var customers = new CustomerStorage(_config);

            return(Ok(customers.UpdateCustomer(id, customer)));
        }