Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从power query设置时如何从标头中删除MaxDataServiceVersion:3.0_C#_.net_Odata - Fatal编程技术网

C# 从power query设置时如何从标头中删除MaxDataServiceVersion:3.0

C# 从power query设置时如何从标头中删除MaxDataServiceVersion:3.0,c#,.net,odata,C#,.net,Odata,我有一个项目,我从ODataV3升级到V4。现在,当我尝试从电源查询连接时,在尝试查看数据时出现错误: Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified method is not supported. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified method is not supported. ---> System

我有一个项目,我从ODataV3升级到V4。现在,当我尝试从电源查询连接时,在尝试查看数据时出现错误:

Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified method is not supported. --->
Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified method is not supported. --->
System.NotSupportedException: Specified method is not supported.

Microsoft.Mashup.Engine1.Library.OData.V4.ODataExpression.VisitColumnAccess(ColumnAccessQueryExpression expression) 
Microsoft.Mashup.Engine1.Library.OData.V4.ODataExpression.Visit(QueryExpression queryExpression)
从我看到的问题是,在Power Query的标题中设置了MaxDataServiceVersion:3.0。如果我没有这个,我可以得到数据


如何从.NET中的标题中删除此项,我使用Web API和OData v4,并从Power Query中调用控制器。

我从Power BI和Power Query中查询我的OData v4服务时遇到了非常类似的问题。在翻阅可用的源文件后,我发现ODataRoute支持此HasRelaxedODataVersionContraint方法

在WebApiConfig.cs中声明OData路由时调用它

config.MapODataServiceRoute("OdataRoute", "odata", GetEdmModel()).HasRelaxedODataVersionConstraint();
对该方法的评论是有意义的;放松版本约束。该服务将允许客户端发送ODataV4和以前的max版本头。先前max版本的标题将被忽略


这只是ODATA由于缺乏焦点而管理不当的另一个例子。我怀疑相关的开发人员将其作为一个宠物项目,而不是一个资助的核心MS项目。

在ASPNET core中有没有实现这一点的方法?