public HttpResponseMessage Post(Customer customer) { session.Store(customer); session.SaveChanges(); HttpResponseMessage response = Request.CreateResponse<Customer>(HttpStatusCode.OK, customer); return response; }
public void UpdateCustomer(Customer customer) { if (string.IsNullOrWhiteSpace(customer.Id)) throw new ArgumentNullException("Customer Id can not be null"); Customer cust = session.Load<Customer>(customer.Id); cust.Name = customer.Name; cust.Money = customer.Money; session.SaveChanges(); Clients.customerUpdated(customer); }
public void AddCustomer(Customer customer) { Clients.customerAdded(customer); }