Skip to content

Commit 460591f

Browse files
committed
Fixes #7, removed old OData dependencies.
1 parent 10c7537 commit 460591f

File tree

2 files changed

+9
-21
lines changed

2 files changed

+9
-21
lines changed

JSONAPI/Http/ApiController.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Net;
66
using System.Net.Http;
77
using System.Web.Http;
8-
using System.Web.OData.Query;
98
using System.Reflection;
109
using JSONAPI.Core;
1110

@@ -26,10 +25,8 @@ protected virtual TM MaterializerFactory<TM>()
2625
}
2726

2827
/// <summary>
29-
/// Override this method to provide an IQueryable set of objects of type T, which
30-
/// will be passed to the OData query processor to support OData queries. If this
31-
/// method is not overridden, an empty List&lt;T&gt; will be returned, which will
32-
/// mean that using OData query parameters will always return no results.
28+
/// Override this method to provide an IQueryable set of objects of type T. If this
29+
/// method is not overridden, an empty List&lt;T&gt; will be returned.
3330
/// </summary>
3431
/// <param name="materializer"></param>
3532
/// <returns></returns>
@@ -39,15 +36,18 @@ protected virtual IQueryable<T> QueryableFactory(IMaterializer materializer = nu
3936
}
4037

4138
//[System.Web.OData.EnableQuery] // Do this yourself!
39+
/// <summary>
40+
/// Default Get method implementation. Returns the result of
41+
/// Note: You can easily add OData query support by overriding this method and decorating
42+
/// it with the [System.Web.OData.EnableQuery] attribute.
43+
/// </summary>
44+
/// <returns></returns>
4245
public virtual IQueryable<T> Get()
4346
{
4447
IMaterializer materializer = MaterializerFactory();
4548

4649
IQueryable<T> es = QueryableFactory(materializer);
47-
// Apply the OData query
48-
//IQueryable<T> queryResults = query.ApplyTo(es) as IQueryable<T>;
49-
50-
//return queryResults;
50+
5151
return es;
5252
}
5353

JSONAPI/JSONAPI.csproj

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@
3737
<DocumentationFile>bin\Release\JSONAPI.XML</DocumentationFile>
3838
</PropertyGroup>
3939
<ItemGroup>
40-
<Reference Include="Microsoft.OData.Core">
41-
<HintPath>..\packages\Microsoft.OData.Core.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
42-
</Reference>
43-
<Reference Include="Microsoft.OData.Edm">
44-
<HintPath>..\packages\Microsoft.OData.Edm.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
45-
</Reference>
46-
<Reference Include="Microsoft.Spatial">
47-
<HintPath>..\packages\Microsoft.Spatial.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
48-
</Reference>
4940
<Reference Include="Newtonsoft.Json">
5041
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
5142
</Reference>
@@ -66,9 +57,6 @@
6657
<SpecificVersion>False</SpecificVersion>
6758
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.2\lib\net45\System.Web.Http.WebHost.dll</HintPath>
6859
</Reference>
69-
<Reference Include="System.Web.OData">
70-
<HintPath>..\packages\Microsoft.AspNet.OData.5.3.1\lib\net45\System.Web.OData.dll</HintPath>
71-
</Reference>
7260
<Reference Include="System.Xml.Linq" />
7361
<Reference Include="System.Data.DataSetExtensions" />
7462
<Reference Include="Microsoft.CSharp" />

0 commit comments

Comments
 (0)