Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Microsoft.OData.Core and Microsoft.Data.OData

I am working on Web Api with OData enabled. I started working by referring to (only the relevant dlls to the question are mentioned)

Microsoft.AspNet.WebApi.OData
Microsoft.Data.OData
Microsoft.Data.Edm
System.Spatial

But when I found out OData is by default case-sensitive, I look for a solution of case insensitive and I have gone through few post Support OData Uri case insensitive parse & ODataLib 6.7.0 Release then finally landed into nuget package Microsoft.OData.Core 6.9.0 which seems to be solving my problem. Here my confusion starts, It has its own collection related libraries under different namespace

Microsoft.OData.Core-----------VS------Microsoft.Data.OData
Microsoft.OData.Edm------------VS------Microsoft.Data.Edm
Microsoft.Spatial--------------VS------System.Spatial

What is difference between above similar libraries, where we should use one upon another? In similar cases of mine, Microsoft.OData.Core can be use instead of Microsoft.Data.OData which is solving case sensitive issue?

like image 641
Premchandra Singh Avatar asked Jan 19 '15 07:01

Premchandra Singh


People also ask

Is OData a Microsoft?

OData stands for the Open Data Protocol. It was initiated by Microsoft and is now an ISO approved and OASIS standard. OData enables the creation and consumption of REST APIs, which allow resources, identified using URLs and defined in a data model, to be published and edited by Web clients using simple HTTP requests.

What is OData in ASP net?

The Open Data Protocol (OData) is a data access protocol for the web. OData provides a uniform way to query and manipulate data sets through CRUD operations (create, read, update, and delete). ASP.NET Web API supports both v3 and v4 of the protocol.

What is OData client?

The OData Client library allows you to consume data from and interact with OData services from . Net apps. There are multiple layers of abstraction available when working with the library: You can use the library directly to interact with any service.


1 Answers

1. About the namespace,


Microsoft.Data.OData
Microsoft.Data.Edm
System.Spatial

are the implementation of OData Version 3.0 Spec. The package name on Nuget end with OData v1-3. For example: ODataLib for OData v1-3

While,

Microsoft.OData.Core
Microsoft.OData.Edm
Microsoft.Spatial

are the implementation of OData Version 4.0 Spec. The package name on Nuget don't contain version . For example: ODataLib

2. About the case-insensitive


Web API OData will support case-insensitive, unqualified function/action call and Enum prefix free in the 5.4 release.

Here's a simple example you can refer to.

The source codes are moved to: WebAPI OData on Github

And you can get the binary from nightly build.

like image 70
Sam Xu Avatar answered Oct 07 '22 21:10

Sam Xu