Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Last active July 26, 2017 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcomartin/5ceca7b4689c7621fc362c1fd46eadb2 to your computer and use it in GitHub Desktop.
Save dcomartin/5ceca7b4689c7621fc362c1fd46eadb2 to your computer and use it in GitHub Desktop.
[EnableQuery]
public IQueryable<Product> Get()
{
return db.Books;
}
[EnableQuery]
public SingleResult<Product> Get([FromODataUri] int key)
{
IQueryable<Product> result = db.Books.Where(p => p.Id == key);
return SingleResult.Create(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment