In my project I am using OData v3 and v4 (ASP.NET Web API with Entity Framework in the back). Currently I built a client using the Visual Studio tools.
But is there another way? Do I really have to build a client based on the $metadata and the toolset?
Is it possible to share my model (contract) by a shared library and build a client like this:
var client = new ODataClient<MySharedModel>(uri);
MySharedModel.Product product =
client.Products.Where(p => p.Category.Name == "Vegetables").FirstOrDefault();
The model can be a set of my own DTO objects which I can map to the equivalent entity framework objects.
My goal is, to share a well-documented model (source code XML documentation) with additional logic such as a ToString
implementation and additional properties. Further more I save a additional step: generating a client (this sucks when you build and publish all your packages automatically on TFS Build server).
Is this possible for OData v3 or OData v4?