public HttpResponseMessage Get()
 {
     return(OK(from row in _productQuery.All()
               select new
     {
         Id = ProductColumns.Id.MapFrom(row),
         Description = ProductColumns.Description.MapFrom(row),
         Price = ProductColumns.Price.MapFrom(row)
     }));
 }
Example #2
0
 public dynamic Get()
 {
     return(new
     {
         Data = _productQuery.All()
                .Select(row => new
         {
             Id = ProductColumns.Id.MapFrom(row),
             Description = ProductColumns.Description.MapFrom(row),
             Price = ProductColumns.Price.MapFrom(row)
         })
     });
 }
Example #3
0
        public async Task <IActionResult> All()
        {
            var products = await _productQuery.All();

            return(Ok(products.Select(ProductModel.FromReadModel)));
        }