by Joche Ojeda | Sep 18, 2018 | DevExpress XPO from step 1 to N, Nuget, XPO
Well, let’s start at the beginning. How do I gain access to use XPO, well there are several install XPO on your next DotNet project, here is a list of them.
- If you own any of DevExpress license you already have access to XPO you can see the available licenses here
- Download the NuGet package: XPO just recently became free to use class library, that’s right, you get to use the most powerful ORM on the DotNet world for free, no questions asked, you can read more about that here. Now to obtain the NuGet package you can use any of the following approaches:
a) Use the console command: Install-Package DevExpress.Xpo -Version 18.1.6
b) Search for the NuGet package using the following package id “DevExpress.Xpo”
Any XPO project should contain references to at least 2 libraries
- DevExpress.Xpo.vXX.X.X in this library you will find all the base objects and attributes necessary to create persistent objects
- DevExpress.Data.vXX.X.X, in this assembly you will find all the necessary objects to query the database using criteria operators and you will also find the ConnectionProviderSql used as a base class for all XPO Providers
After installing the NuGet package or adding the assembly references you are ready to start creating your O.R.M classes
by Joche Ojeda | Sep 18, 2018 | Nuget, Xamarin, XPO
When I got the news that XPO will run on DotNetCore, NetStandard and Xamarin I was super excited about all the new possibilities and to be able to port all the years of experience with XPO to the Xamarin platform.
A few days after the announcement of XPO being able to run on DotNetCore and NetStandard developer express publish a video tutorial and the source on GitHub.
As always like in any video tutorial most of the setup steps are not shown, so you need to do a little research to make your personal project work and I would say most of the time these steps are not that obvious.
I decided to test XPO on Xamarin forms and save data on an SQLite database, so as with every Xamarin project the first step is to install all the necessary nuggets for your project. So, to make it easier for myself I check the source code that DevExpres publish and I was surprised about how many references you need to run SQLite on both Android and iOS platforms. If you want to check the complete list of nuget references needed, click on the following links
To set up all the nuggets reference on both platforms took me around 15 minutes which I think it’s a lot, but then I said, “it does not matter, you only have to do this once right”… well no, since I was so excited that XPO is now able to run on Xamarin I started to create a lot of test projects and migrate some old projects too and every time I have to run to the process of install all the nuggets references.
So, to make my life easier I decided to create a NuGet package with all the references for each platform so here they are
On iOS you will need to add the following lines to your application class inside of the main method
//Initialize SQLite with the sqlite3 provider
SQLitePCL.Batteries_V2.Init();
I hope both Nugets will save you time when you start using XPO on Xamarin