Example #1
0
        public PaggedCollection <OrderDTO> GetOrders(int page)
        {
            PaggedCollection <Order> ordersPagged = orderRepository.GetAllPagged(page);

            List <OrderDTO> ordersDTO = ordersPagged.List.Select(o => OrderDTO.ToDTO(o)).ToList();

            PaggedCollection <OrderDTO> ordersDTOPagged = new PaggedCollection <OrderDTO>();

            ordersDTOPagged.TotalCount = ordersPagged.TotalCount;
            ordersDTOPagged.List       = ordersDTO;

            return(ordersDTOPagged);
        }