public async Task <GetProductionStatusForEditOutput> GetProductionStatusForEdit(EntityDto input) { var productionStatus = await _productionStatusRepository.FirstOrDefaultAsync(input.Id); var output = new GetProductionStatusForEditOutput { ProductionStatus = ObjectMapper.Map <CreateOrEditProductionStatusDto>(productionStatus) }; return(output); }
public async Task <PartialViewResult> CreateOrEditModal(int?id) { GetProductionStatusForEditOutput getProductionStatusForEditOutput; if (id.HasValue) { getProductionStatusForEditOutput = await _productionStatusesAppService.GetProductionStatusForEdit(new EntityDto { Id = (int)id }); } else { getProductionStatusForEditOutput = new GetProductionStatusForEditOutput { ProductionStatus = new CreateOrEditProductionStatusDto() }; } var viewModel = new CreateOrEditProductionStatusModalViewModel() { ProductionStatus = getProductionStatusForEditOutput.ProductionStatus, }; return(PartialView("_CreateOrEditModal", viewModel)); }