[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Collapse]eXpress Persistent Objects
 [Expand]Product Information
 [Expand]Getting Started
 [Expand]Fundamentals
 [Expand]Feature Center
 [Expand]Concepts
 [Collapse]Design-Time Features
   Built-in Visual Studio Templates
   Data Model Designer
   Data Model Wizard
   OData Service Wizard
 [Expand]Examples
 [Expand]Member Tables
 [Expand]API Reference
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

OData Service Wizard

XPO provides the OData Service Wizard which creates a web service project implementing an OData Service that supports the OData Version 3.0 protocol and exposes an XPO model. The project can also include a visual data model that can be edited in the Data Model Designer.

To invoke the OData Service Wizard, use the DXperience v18.2 ORM OData Service's built-in project template in the DevExpress: Visual C# | WCF and DevExpress: Visual Basic | WCF categories.

The wizard displays the following window after selecting the template and clicking OK:

The ODataLib for OData package is downloaded automatically if you choose Download the latest version from NuGet. To use a specific installed version, select Use specific version and specify the version in the text box below. If the Use DXperience ORM Data Model Wizard checkbox is ticked, then the Data Model Wizard starts immediately after clicking OK.

You can try this functionality in the XPO Tutorials demo's Transferring Data via WCF | XPO OData Service section (C:\Users\Public\Documents\DevExpress Demos 18.2\Components\WinForms\Bin\XpoTutorials.exe).

The DevExpress.Xpo.XpoDataServiceV3 class descendant represents the OData service. If the Data Model Wizard was not used to create a model from an existing database, the data layer needs to be configured manually in the static CreateDataLayer method.

Note

The XpoDataServiceV3 does not support composite keys. This could cause the "The entity type 'XXX' does not have any key properties. Please make sure that one or more key properties are defined for this entity type." error with the XPO OData Service if you map your persistent class to a table or view with a multi-column key. This also applies to the XAF Mobile UI because it uses the XPO OData Service. We do not recommend using composite keys as they impose many limitations on the default functionality. Refer to the How to create a persistent object for a database table with a compound key article for more details.

Expanded See Also

Is this topic helpful?​​​​​​​