Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
744 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...