Пример #1
0
        public IHttpActionResult Get(ODataQueryOptions <Order> queryOptions, [FromODataUri] System.Guid key)
        {
            logger.Trace("Call OrderController Get by Id");

            var query = orderRepository.GetById(key);

            var lineQuery = orderLineRepository.GetByOrderId(key).Select(r =>
            {
                r.Item = productRepository.GetById(r.ItemId);
                return(r);
            });

            query.Lines = lineQuery.ToList();

            return(Ok(query));
        }