How is it possible to use OData in .net core application?

做~自己de王妃 提交于 2019-12-24 03:35:11

问题


According to docs (http://odata.github.io/WebApi/#11-01-OData-V4-Web-API-Scaffolding) it is required to inherit from ODataController. I have installed package using nuget and still not able to inherit from that class. Does OData support .net core? Are docs obsolete?


回答1:


A possible duplicate of OData Support in ASP.net core

The docs link that you mentioned is targeting .NET Framework. For .NET Core support, please download the Microsoft.AspNetCore.OData NuGet Package from

https://www.nuget.org/packages/Microsoft.AspNetCore.OData

This package has a dependency on Microsoft.OData.Core which will also get installed automatically. Starting from version 7.2.0 the package is targeting .NET Standard 1.1.

Once the package is referenced, You should be able to inherit from ODataController. For further details please refer to the following video and links

https://www.towfeek.se/2017/01/08/odata-with-aspnet-core/

http://odata.github.io/odata.net/v7/#ODL-7.3.1

I hope this helps



来源:https://stackoverflow.com/questions/45743055/how-is-it-possible-to-use-odata-in-net-core-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!