public ListResultDto <ProjectSupplementListDto> GetAllProjectSupplements(GetProjectSupplementListInput input) { var query = _projectSupplementRepository.GetAll().Where(r => r.ProjectBaseId == input.ProjectId); var projectSupplements = query .OrderBy(input.Sorting) .ToList(); return(new ListResultDto <ProjectSupplementListDto> { Items = projectSupplements.MapTo <List <ProjectSupplementListDto> >() }); }
public async Task <bool> ProjectExitSupplements(GetProjectSupplementListInput input) { var query = _projectSupplementRepository.GetAll().Where(r => r.ProjectBaseId == input.ProjectId && r.HasSupplement == false); var exitcount = await query.CountAsync(); if (exitcount > 0) { return(true); } else { return(false); } }
public async Task <PagedResultDto <ProjectSupplementListDto> > GetProjectSupplements(GetProjectSupplementListInput input) { try { var query = _projectSupplementRepository.GetAll().Where(r => r.ProjectBaseId == input.ProjectId); var count = await query.CountAsync(); var projectSupplements = await query .OrderBy(input.Sorting) .PageBy(input) .ToListAsync(); var periodDtos = projectSupplements.MapTo <List <ProjectSupplementListDto> >(); return(new PagedResultDto <ProjectSupplementListDto>(count, periodDtos)); } catch (Exception ex) { throw; } }