File tree Expand file tree Collapse file tree 2 files changed +9
-21
lines changed
Expand file tree Collapse file tree 2 files changed +9
-21
lines changed Original file line number Diff line number Diff line change 55using System . Net ;
66using System . Net . Http ;
77using System . Web . Http ;
8- using System . Web . OData . Query ;
98using System . Reflection ;
109using 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<T> 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<T> 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
Original file line number Diff line number Diff line change 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 >
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" />
You can’t perform that action at this time.
0 commit comments