- 2 minutes to read
Install the DevExpress.Xpo NuGet package to add XPO assemblies to applications that target .NET.
ASP.NET Core Support
XPO implements extension methods for the standard IServiceCollection interface to register XPO services for the ASP.NET Core pipeline. This follows best practices for the platform and enables automatic management of the Data Layer and Session life cycles. For more information, refer to ASP.NET Core Dependency Injection in XPO and examples in Getting Started.
You can use XPO as a Data Access layer in an ASP.NET Core Web API service.
This example demonstrates how to implement an XPO-based REST service and use the Newtonsoft.Json library to serialize/deserialize XPO objects.
Migration From the .NET Framework
.NET misses a part of APIs that are present in the .NET Framework. Use the .NET Portability Analyzer tool to determine whether your application uses such APIs.
You can refactor your code to reduce the number of calls to missing APIs. Look for an alternative API with the required functionality.
Useful resource: .NET Framework technologies unavailable on .NET Core.
XPO for .NET has the following limitations:
The GetConnectionProvider(String, AutoCreateOption) and GetDataLayer(String, AutoCreateOption) methods do not work if you pass a URL to a WCF service as the
connectionStringparameter. For more information, refer to the WCF client in .NET Core Support Center ticket.
You cannot use service classes listed in the Transferring Data using WCF Services topic in .NET. Use WebApiDataStoreClient and WebApiDataStoreService instead. For more information, refer to the following help topic: Transfer Data via ASP.NET Core Web API / REST API.
Design-time support for XPCollection and other XPO data source components relies on Visual Studio capabilities and is not available in .NET projects.