Exemplo n.º 1
0
        public virtual async Task <SearchResponse <EmailMessage> > Search(EmailMessageSearchRequestModel model)
        {
            var query = Db.EmailMessages.Where(t => t.Email.Equals(model.Email)).OrderByDescending(a => a.Id);

            return(new SearchResponse <EmailMessage>
            {
                Data = await query.Skip(model.PageIndex *model.PageSize).Take(model.PageSize).ToListAsync(),
                TotalCount = await query.CountAsync(),
                PageSize = model.PageSize,
                PageIndex = model.PageIndex
            });
        }
 public virtual async Task <SearchResponse <EmailMessage> > Search(EmailMessageSearchRequestModel model)
 {
     return(await _messageHandler.Search(model));
 }