public async Task <DataWithCount <ICollection <Program> > > GetPaginatedProgramListAsync( BaseFilter filter) { VerifyPermission(Permission.ManagePrograms); filter.SiteId = GetCurrentSiteId(); return(new DataWithCount <ICollection <Program> > { Data = await _programRepository.PageAsync(filter), Count = await _programRepository.CountAsync(filter) }); }
public async Task <Program> AddProgramAsync(Program program) { VerifyPermission(Permission.ManagePrograms); var siteId = GetCurrentSiteId(); var filter = new BaseFilter() { SiteId = siteId }; program.Position = await _programRepository.CountAsync(filter); program.SiteId = siteId; return(await _programRepository.AddSaveAsync(GetClaimId(ClaimType.UserId), program)); }