コード例 #1
0
        /// <summary>
        /// Get all labels.
        /// </summary>
        /// <param name="paginationParams"></param>
        /// <param name="userId"></param>
        /// <returns>Returns all labels for user.</returns>
        public async Task <PagedList <LabelDto> > GetAllLabels(PaginationParameters paginationParams, long userId)
        {
            List <LabelDto> Labels = await _labelDbOps.GetAllLabels(userId);

            if (!string.IsNullOrWhiteSpace(paginationParams.SearchText))
            {
                Labels = Labels.Where(p => p.Description.Contains(paginationParams.SearchText)).ToList();
            }
            return(PagedList <LabelDto> .ToPagedList(Labels, paginationParams.PageNumber, paginationParams.PageSize));
        }
コード例 #2
0
ファイル: Query.cs プロジェクト: onkarsngh11/HomeWork_ToDos
 /// <summary>
 /// Get labels.
 /// </summary>
 /// <returns>Returns labels.</returns>
 public async Task <List <LabelDto> > GetAllLabels()
 {
     return(await _labelDbOps.GetAllLabels(_userId));
 }