I'm new to OData and I have a question about using it in my .NET Web API. In my web API if I have a controller with the following Get method:
[EnableQuery()]
public IQueryable<Product> Get()
{
var productRepository = new ProductRepository();
return productRepository.Retrieve().AsQueryable();
}
Is it necessary for me to retrieve all products before the OData query options are applied or is there a way for me to only retrieve products using the OData query options?
I wouldn't want to have to retrieve all products which could be over 100,000 and then have the OData query options applied to only return like 10 records based off of my criteria.
Thanks for any help with this question.
Aucun commentaire:
Enregistrer un commentaire