Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
750 views
in Technique[技术] by (71.8m points)

rest - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...