/// <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)); }
/// <summary> /// Get labels. /// </summary> /// <returns>Returns labels.</returns> public async Task <List <LabelDto> > GetAllLabels() { return(await _labelDbOps.GetAllLabels(_userId)); }