Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Created Issue: Queryable won't work for normal web api after adding odata service [692]

$
0
0
The scenario is that after user added odata service to an existing web api application, the old api's queryable won't work as before.

The reason is that we set the global edm model when EnableOData is called. If the old api's model is not in the odata's model, our code will throw error on it.

The error message is:
<?xml version="1.0" encoding="utf-8"?>
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code />
<m:message xml:lang="en-US">An error has occurred.</m:message>
<m:innererror>
<m:message>No EntitySet exists in the EdmModel with EntityClrType 'WebStack.QA.Test.OData.Common.Models.Products.Product'.</m:message>
<m:type>System.InvalidOperationException</m:type>
<m:stacktrace> at System.Web.Http.OData.ODataQueryContext..ctor(IEdmModel model, Type entityClrType) in C:\dd\DevDiv\Offcycle\WPT\WebStackRuntime\runtime\src\System.Web.Http.OData\OData\ODataQueryContext.cs:line 65&#xD;
at System.Web.Http.QueryableAttribute.CreateQueryContext(Type entityClrType, HttpConfiguration configuration, HttpActionDescriptor actionDescriptor) in C:\dd\DevDiv\Offcycle\WPT\WebStackRuntime\runtime\src\System.Web.Http.OData\QueryableAttribute.cs:line 389&#xD;
at System.Web.Http.QueryableAttribute.ExecuteQuery(IEnumerable query, HttpRequestMessage request, HttpConfiguration configuration, HttpActionDescriptor actionDescriptor) in C:\dd\DevDiv\Offcycle\WPT\WebStackRuntime\runtime\src\System.Web.Http.OData\QueryableAttribute.cs:line 346&#xD;
at System.Web.Http.QueryableAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext) in C:\dd\DevDiv\Offcycle\WPT\WebStackRuntime\runtime\src\System.Web.Http.OData\QueryableAttribute.cs:line 280&#xD;
at System.Web.Http.Tracing.Tracers.ActionFilterAttributeTracer.&lt;&gt;c__DisplayClass4.&lt;OnActionExecuted&gt;b__1()&#xD;
at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEnd(ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Action execute, Action`1 endTrace, Action`1 errorTrace)&#xD;
at System.Web.Http.Tracing.Tracers.ActionFilterAttributeTracer.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)&#xD;
at System.Web.Http.Filters.ActionFilterAttribute.CallOnActionExecuted(HttpActionContext actionContext, HttpResponseMessage response, Exception exception)&#xD;
at System.Web.Http.Filters.ActionFilterAttribute.&lt;&gt;c__DisplayClass2.&lt;System.Web.Http.Filters.IActionFilter.ExecuteActionFilterAsync&gt;b__0(HttpResponseMessage response)&#xD;
at System.Threading.Tasks.TaskHelpersExtensions.&lt;&gt;c__DisplayClass41`2.&lt;Then&gt;b__40(Task`1 t)&#xD;
at System.Threading.Tasks.TaskHelpersExtensions.ThenImpl[TTask,TOuterResult](TTask task, Func`2 continuation, CancellationToken cancellationToken, Boolean runSynchronously)</m:stacktrace>
</m:innererror>
</m:error>

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>