public void CreateDetailOrder(SaveDetailOrderDto saveDetailOrderDto) { var detailorder = _mapper.Map <SaveDetailOrderDto, DetailOrder>(saveDetailOrderDto); _unitOfWork.DetailOrders.Add(detailorder); _unitOfWork.Complete(); }
public void UpdateDetailOrder(SaveDetailOrderDto saveDetailOrderDto) { var detailorder = _unitOfWork.DetailOrders.GetBy(saveDetailOrderDto.DetailOrderId); if (detailorder == null) { return; } _mapper.Map <SaveDetailOrderDto, DetailOrder>(saveDetailOrderDto, detailorder); _unitOfWork.Complete(); }
public IActionResult OnGet(int?id) { if (id == null) { return(NotFound()); } var detailorder = _service.GetDetailOrder(id ?? default(int)); if (detailorder == null) { return(NotFound()); } DetailOrder = _mapper.Map <DetailOrderDto, SaveDetailOrderDto>(detailorder); return(Page()); }