public static async Task <T> SetLoadedGet <T>(IEntityService service, IEntityException exceptionService, EntitySubEntitiesGetDto dto, string function) { exceptionService.ThrowEntityNotFoundExceptionIfIdDoesNotExist(dto.Id); var date = DateTimeParser.FromWebFormat(dto.Date); var entities = await service.GetAll(function, dto.Id, date).ToListAsync(); dto.Entities = entities; return(AutoMapperConfig.MapperInstance.Map <T>(dto)); }
public async Task <IActionResult> LoadedShareClasses(int id, string date, string container) { var dto = new EntitySubEntitiesGetDto() { Id = id, Date = date, Container = container, }; var viewModel = await SubEntitiesVMSetup .SetLoadedGet <EntitySubEntitiesViewModel>(this.service, this.subFundService, dto, SqlFunctionDictionary.SubFundShareClasses); return(this.PartialView("SubEntities/_ViewLoadedTable", viewModel)); }