问题
I am creating a RESTful service using Web API and Entity Framework with OData endpoints. The Microsoft.AspNet.WebApi.OData and Microsoft.Data.OData and Microsoft.AspNet.OData packages seem to overlap, so I wasn't sure which one to use. What are the differences between them? What are the pros and cons of each?
回答1:
Microsoft.AspNet.OData is the one you'll most likely want to use for a new project. It sets up Web API to use the OData 4 protocol.
Microsoft.AspNet.WebApi.OData is the older package for OData v1-3. It has a dependency on some of the core OData pieces from Microsoft.Data.OData, which is the "ODataLib" package for OData v1-3. (The OData v4 version of this is Microsoft.OData.Core, which is a dependency of Microsoft.AspNet.OData
.)
来源:https://stackoverflow.com/questions/38774217/what-is-the-difference-between-microsoft-aspnet-webapi-odata-and-microsoft-data