コード例 #1
0
 public ActionResult Delete(OrderDetailDto item)
 {
     using(_conversation.SetAsCurrent())
     {
         OrderDetail itemMapped = _mapper.Map<OrderDetailDto, OrderDetail>(item);
         _repository.Delete(itemMapped);
         _conversation.Flush();
         return Json(new{ success = true });
     }
 }
コード例 #2
0
 public ActionResult Create(OrderDetailDto item)
 {
     using(_conversation.SetAsCurrent())
     {
         OrderDetail itemMapped = _mapper.Map<OrderDetailDto, OrderDetail>(item);
         ValidationHelpers.AddErrorsToModelState(ModelState, _validator.Validate(itemMapped), "item");
         if(ModelState.IsValid)
         {
             _repository.Create(itemMapped);
             _conversation.Flush();
         }
         return Json(new{ success = true });
     }
 }