public async Task <GetJetForEditOutput> GetJetForEdit(EntityDto input) { var jet = await _jetRepository.FirstOrDefaultAsync(input.Id); var output = new GetJetForEditOutput { Jet = ObjectMapper.Map <CreateOrEditJetDto>(jet) }; return(output); }
public async Task <PartialViewResult> CreateOrEditModal(int?id) { GetJetForEditOutput getJetForEditOutput; if (id.HasValue) { getJetForEditOutput = await _jetsAppService.GetJetForEdit(new EntityDto { Id = (int)id }); } else { getJetForEditOutput = new GetJetForEditOutput { Jet = new CreateOrEditJetDto() }; } var viewModel = new CreateOrEditJetModalViewModel() { Jet = getJetForEditOutput.Jet, }; return(PartialView("_CreateOrEditModal", viewModel)); }