public object Put(UpdateCustomer request) { var entity = request.ConvertTo <Customer>(); return(InTransaction(db => { Logic.Update(entity); return new CommonResponse(Logic.GetById(entity.Id)); })); }
public object Put(UpdateCustomer request) { var customer = this.Db.LoadSingleById<Customer>(request.Id); customer = customer.PopulateWith(request.ConvertTo<Customer>()); this.Db.Update(customer); //Invalidate customer details cache this.Cache.ClearCaches(CacheKey.Fmt(request.Id)); return new UpdateCustomerResponse() { Result = customer }; }
public object Put(UpdateCustomer request) { var customer = this.Db.LoadSingleById <Customer>(request.Id); customer = customer.PopulateWith(request.ConvertTo <Customer>()); this.Db.Update(customer); //Invalidate customer details cache this.Cache.ClearCaches(CacheKey.Fmt(request.Id)); return(new UpdateCustomerResponse() { Result = customer }); }