//[Authorize] public async Task <ActionResult> Create([FromBody, Bind("FirstName, LastName, Email, Password")] API.Models.APICustomer customer) { Logic.Customer cus = new Logic.Customer { CustomerID = customer.CustomerID, FirstName = customer.FirstName, LastName = customer.LastName, Email = customer.Email, Password = customer.Password }; await iRepo.CreateCustomer(cus); return(CreatedAtRoute("GetCustomer", new { id = cus.CustomerID }, cus)); }
public async Task <IActionResult> Put([FromBody] API.Models.APICustomer Acustomer) { Logic.Customer cus = new Logic.Customer(); IEnumerable <Logic.Customer> Lcustomers = await iRepo.ReadCustomerList(cus); //Remember to add try catch or some exception handling Logic.Customer newCus = new Logic.Customer { CustomerID = Acustomer.CustomerID, FirstName = Acustomer.FirstName, LastName = Acustomer.LastName, Email = Acustomer.Email, Password = Acustomer.Password }; await iRepo.UpdateCustomer(newCus); return(Ok()); }