This repository contains demo projects demonstrating how to use eXpressPersistent Objects™ (XPO) in .NET Standard 2.0 applications. You can use these projects to learn how to use XPO in console, ASP.NET Core or Xamarin applications. All required DevExpress references are included.
Download and install .NET Core 2.0 SDK.
Clone this repository:
git clone https://github.com/DevExpress/XpoNetCoreDemos.git
If you do not have Git installed, download and extract the ZIP archive using the GitHub web interface.
The solution located in the XpoConsoleCoreDemo subfolder is a .NET Standard 2.0 console application, demonstrating how to initialize the data layer and perform basic data operations. To run the application, execute the following commands in the repository root folder (XpoNetCoreDemos by default):
cd XpoConsoleCoreDemo\XpoConsoleCoreDemo
dotnet restore
dotnet run
The project is configured to use a local SQLite database. You can modify the code in the Program.cs file to configure another database connection (e.g., MS SQL Server or any other supported database).
The solution located in the XpoASPNETCoreDemo subfolder is a .NET Standard 2.0 console application that displays a simple view with basic operations (create, delete, list). To run the application, execute the following commands in the repository root folder:
cd XpoASPNETCoreDemo\DevExpress.Xpo.AspNetCoreDemo
dotnet restore
dotnet run
Then, open http://localhost:5000 in your web browser.
The project is configured for a local SQLite database. Modify the Startup.cs and appsettings.json files to configure another database connection (e.g., MS SQL Server or any other supported database).
The solution located in the XpoXamarinFormsDemo subfolder demonstrates the use of XPO in Xamarin.Forms. It contains the following projects:
- DevExpress.Xpo.XamarinFormsDemo.UI - the common .NET Standard 2.0 project with business logic (data layer initialization, data manipulation) and page layouts;
- DevExpress.Xpo.XamarinFormsDemo.Android
- Android app project;
- DevExpress.Xpo.XamarinFormsDemo.iOS
- iOS app project;
- DevExpress.Xpo.XamarinFormsDemo.UWP - UWP app project.
To try this demo, open the solution in Visual Studio 2017 for Windows 15.4.0 or Visual Studio 2017 for Mac 7.2.0 or a newer version. In order to use .NET Standard 2.0 in UWP, you need to target "Windows 10 Fall Creators Update" as the minimum version of your UWP project.
The demo is configured to use the in-memory data provider with XML storage. Modify the App.xaml.cs file in the DevExpress.Xpo.XamarinFormsDemo.UI project to configure another database connection (e.g., SQLite, MS SQL Server or any other supported database).
If you have any questions regarding these demo projects, contact us via the DevExpress Support Center.
This tutorial demonstrates how to create an XPO-based .NET Standard 2.0 console application that initializes the data layer and performs basic data operations: Getting Started with .NET Core.
We would greatly appreciate it if you participate in this short survey (6 questions, ~3 min).
