2

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?

emihailov
  • 101
  • 2
  • 8

1 Answers1

2

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

Shahzad Hassan
  • 993
  • 7
  • 14
  • What was presented on tofeek doesn't work with .NET Standard 2.0.0 – Gerald Hughes Oct 16 '17 at 14:56
  • 1
    Apologies for the late reply. I mentioned in the answer that the package is targeting .NET Standard 1.1. The information in the video is a little bit outdated but relevant since the release of .NET Standard 2.0.0. According to the answer [here](https://github.com/OData/WebApi/issues/939#issuecomment-322898525) migration to .NET Standard 2.0.0 is still in progress – Shahzad Hassan Feb 12 '18 at 13:16
  • Just realised that the pre-release [package](https://www.nuget.org/packages/Microsoft.AspNetCore.OData/7.0.0-beta1) does have a dependency on .NET Standard 2.0.0. However, there is no mention of .Net Standard 2.0.0 on the official [Odata Page](http://odata.github.io/odata.net/v7/#ODL-7.4.0) – Shahzad Hassan Feb 12 '18 at 13:24