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()));
        }
示例#2
0
 public static ModuleUpdateModel ToModuleUpdateModel(this GetModuleByIdDto dto)
 {
     return(dto.MapTo <GetModuleByIdDto, ModuleUpdateModel>());
 }