Ejemplo n.º 1
0
        public QueryResult <Broker> GetBrokers(PagedDataRequest requestInfo)
        {
            var startIndex     = ResultsPagingUtility.CalculateStartIndex(requestInfo.PageNumber, requestInfo.PageSize);
            var context        = new InformingDBContext();
            var query          = context.Brokers;
            var totalItemCount = query.Count();
            var brokers        = query.Skip(startIndex).Take(requestInfo.PageSize).ToList();
            var queryResult    = new QueryResult <Broker>(brokers, totalItemCount, requestInfo.PageSize);

            return(queryResult);
        }
 public BrokerByIdQueryProcessor(InformingDBContext context)
 {
     _context = context;
 }