public async Task <ActionResult> Update(int id) { GetModuleByIdDto getModuleByIdDto = await Mediator.Send(new GetModuleByIdQuery { Id = id }); if (getModuleByIdDto != null) { return(View(getModuleByIdDto.ToModuleUpdateModel())); } return(View(new ModuleUpdateModel())); }
public static ModuleUpdateModel ToModuleUpdateModel(this GetModuleByIdDto dto) { return(dto.MapTo <GetModuleByIdDto, ModuleUpdateModel>()); }