public Customer Update(Customer customer)
 {
     using (var client = new HttpClient())
     {
         //Put (update) movie object as json formatting to our web API localhost
         HttpResponseMessage response =
             client.PutAsJsonAsync("http://localhost:13993/api/customers/" + customer.ID, customer).Result;
         return response.Content.ReadAsAsync<Customer>().Result;
     }
 }
示例#2
0
 public ActionResult Update(Customer customer)
 {
     facade.GetCustomerGateway().Update(customer);
     return Redirect("Index");
 }
示例#3
0
 public ActionResult Create(Customer customer)
 {
     var returnedCustomer = facade.GetCustomerGateway().Create(customer);
     return Redirect("Index");
 }