在.net核心应用程序中如何使用OData? [英] How is it possible to use OData in .net core application?

查看:112
本文介绍了在.net核心应用程序中如何使用OData?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据文档( http://odata.github.io/WebApi/#11-01-OData-V4-Web-API-Scaffolding ),则需要从ODataController继承. 我已经使用nuget安装了程序包,但仍然无法从该类继承. OData是否支持.net核心?文档过时了吗?

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?

推荐答案

ASP.net核心中的OData支持

您提到的docs链接针对.NET Framework.要获得.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

此软件包依赖于Microsoft.OData.Core,它也会自动安装.从7.2.0版开始,该软件包的目标是.NET Standard 1.1.

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.

一旦引用了包,您就应该能够从ODataController继承.有关更多详细信息,请参阅以下视频和链接

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

我希望这对您有帮助

这篇关于在.net核心应用程序中如何使用OData?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆