Esempio n. 1
0
        public IEnumerable <Quote> ListQuotes(ListQuotesRequest filter)
        {
            var query = _db.Quotes
                        .Where(
                x => x.DeletedAt == null &&
                x.GuildId == filter.GuildId &&
                x.ChannelId == filter.ChannelId
                );

            query = query
                    .OrderByDescending(x => x.CreatedAt)
                    .Skip((filter.PageNumber - 1) * filter.PageSize)
                    .Take(filter.PageSize);

            return(query.ToList());
        }
Esempio n. 2
0
        public IHttpActionResult Get([FromUri] ListQuotesRequest request)
        {
            var result = _listQuoteRequestProcessor.Process(request);

            return(Ok(result));
        }