示例#1
0
        public void Update(TViewModel model)
        {
            var entity = Mapper.Map <TViewModel, TBaseModel>(model);

            _service.Update(entity);
            _uow.Commit();
        }
 public virtual ActionResult Edit([Bind(Include = "Id,Name")] CustomerViewModel model)
 {
     if (ModelState.IsValid)
     {
         _customerHandler.Update(model.CreateCustomerDomain());
         _customerHandler.Commit();
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
示例#3
0
 public virtual ActionResult Edit(ProductViewModel model)
 {
     if (ModelState.IsValid)
     {
         _productHandler.Update(model.CreateProductDomain());
         _productHandler.Commit();
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }