public IEnumerable <Program> GetPrograms(PagingInfo pagingInfo = null) { if (pagingInfo == null) { return(_programRepository.Get(null, null, t => t.PaySources)); } else { int total = 0; var result = _programRepository.FilterWithPaging(null, (list => list.OrderBy(p => p.Name)) , out total, pagingInfo.PageIndex, AppSettings.PageSize, t => t.PaySources); pagingInfo.Total = total; return(result); } }