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) })); }
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) }) }); }
public async Task <IActionResult> All() { var products = await _productQuery.All(); return(Ok(products.Select(ProductModel.FromReadModel))); }