Esempio n. 1
0
        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
     };
 }
Esempio n. 3
0
        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
            });
        }