public async Task <NotificationFilterDto> SearchNotifications(NotificationFilterDto model)
        {
            var expression = GetSearchExpressionNotifications(model);

            (var query, int totalCount) = await AuditUnitOfWork.NotificationRepository.GetPagedByFiltersAsync(
                model.PageNumber,
                model.jtPageSize.Value,
                expression,
                a => a.OrderByDescending(d => d.Date));

            model.Items = query.Select(notification => NotificationMapper.MapToDto(notification)).ToList();

            model.TotalCount = totalCount;

            return(model);
        }
        List <Expression <Func <Notification, bool> > > GetSearchExpressionNotifications(NotificationFilterDto model)
        {
            List <Expression <Func <Notification, bool> > > filterList = new List <Expression <Func <Notification, bool> > >();


            if (!string.IsNullOrEmpty(model.From))
            {
                filterList.Add(c => c.From.Contains(model.From));
            }

            if (model.Sent != null)
            {
                filterList.Add(c => c.Sent == model.Sent);
            }

            if (!string.IsNullOrEmpty(model.Subject))
            {
                filterList.Add(c => c.Subject.Contains(model.Subject));
            }

            if (!string.IsNullOrEmpty(model.ToEmails))
            {
                filterList.Add(c => c.ToEmails.Contains(model.ToEmails));
            }

            if (!string.IsNullOrEmpty(model.Audit_ActionCode))
            {
                filterList.Add(c => c.Audit_ActionCode.Contains(model.Audit_ActionCode));
            }

            if (model.FromDate != null)
            {
                filterList.Add(c => c.Date.Date >= model.FromDate);
            }

            if (model.ToDate != null)
            {
                filterList.Add(c => c.Date.Date <= model.ToDate);
            }

            return(filterList);
        }