I'm trying to enable OData in a Web Api class and am adding the attribute [Queryable] to my query
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
public class ItemsController : ApiController
{
...
[HttpGet]
[Queryable]
public IQueryable<Item> GetItems()
{
return _repository.Items.AsQueryable();
}
but Visual Studio tells me
'Queryable' is not an attribute"
and I get a compilation error:
CS0616: 'System.Linq.Queryable' is not an attribute class
If I qualify the attribute
[System.Web.Http.Queryable]
I get another error message
CS0234: The type or namespace name 'Queryable' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?)
Any ideas why the [Queryable] doesn't seem to be recognised? This is a Web forms application to which Web API has been added at a later date.