public ActionResult Delete(ShipperDto item) { using(_conversation.SetAsCurrent()) { Shipper itemMapped = _mapper.Map<ShipperDto, Shipper>(item); _repository.Delete(itemMapped); _conversation.Flush(); return Json(new{ success = true }); } }
public ActionResult Create(ShipperDto item) { using(_conversation.SetAsCurrent()) { Shipper itemMapped = _mapper.Map<ShipperDto, Shipper>(item); ValidationHelpers.AddErrorsToModelState(ModelState, _validator.Validate(itemMapped), "item"); if(ModelState.IsValid) { _repository.Create(itemMapped); _conversation.Flush(); } return Json(new{ success = true }); } }