Parts Of OData
Below diagram explains about the high level architecture of the OData. There are four main parts of OData (Data Model, Data Service, Protocol and Client libraries) are used to connect the client and data source which is explained below.
OData Data Model: It provides the generic way to organize and describe the data by using Entity Data Model (EDM), which is similar to Microsoft Entity Framework. Learn more...
OData Protocol: It is protocol used by client to send request and receive response. OData protocol is just like HTTP and used to do CRUD operation by using OData - predefined query language. It transfers the data in form of XML or JSON. Learn more...
OData Service: It is service layer on top of OData Model and it exposes an endpoint that allows client to access the data using OData Protocol and OData Client library. It converts the different format of data source like SQL relation tables, SharePoint list, Windows Azure tables etc into common format for client to use. Learn more...
OData Client libraries: It is client libraries used by client application to access the data using OData Protocol. To make life simple Microsoft has already provided the pre-defined libraries for different platform (like mobile, custom application etc.) to send and receive data. Learn more...
Tips!
- Always create the service with Interface->Implementation format, mention the contract in Interface.
- Define the service in Class library and refer the class library in Host project. Don’t use service class in host project.
- Change the instance mode to per call as default.
- Always catch exception using try/catch block and throw exception using FaultException < T >.
- Logging and Include exception should be enable while compiling the project in debug mode. While in production deployment disable the logging and Include exception details.