I have just started a new role as Junior developer using C# and Visual Studio 2012. I only found that my company use DevExpress Xpress Persistent Object (ORM) for Data Access when I joined them last week. This is new to me and I have been teaching myself how to use it using the devExpress documentation website
here .
The problem is the documentation contains loads of information that I do not need at the moment because I need something to get me running ASAP. I have spent a lot of time searching for tutorials on google but nothing good shows up. Does any one know of any tutorial link that can get me building projects rightaway using DevExpress XPO?.
Anyhelp or suggestions will be highly appreciated. For a while i had thought about doing a quick start guide for XPO as i went through the same thing you did as well. DevExpress documentation is nice but it is a TON of information to sift through. There isn't really any quick start guide to XPO per-say...maybe i'll write my first article finally.
I am going to make a few assumptions here, like you are using sql server as your backend.
One thing to keep in mind, if you are doing this/will ever get into using XPO with web applications you want to make sure EVERY SINGLE CALL you make using XPO is wrapped in a using(var uow = new UnitOfWork(), otherwise you get some nasty cross threading errors.
I use "YourClassName" in my examples. That is going to be your XPO objects that you either generate using the DevExpress ORM wizard or whatever it is you create by hand.
If you've got any other questions about xpo feel free to reach out to me.
// Initialize your data layer. // By default if you don't do this, XPO will try and use an access databse (jet) Session session = new Session(); XpoDefault.DataLayer = XpoDefault.GetDataLayer(MSSqlConnectionProvider.GetConnectionString( " YourServerHostnameOrIP" , " DB Username" , " DB Password" , " DB Name" ), AutoCreateOption.None); XpoDefault.Session = session; // Equivalent of SELECT * FROM TableName in SQL // YourClassName would be your XPO object (your persistent object) using ( var uow = new UnitOfWork()) XPCollection<yourclassname> getRecords = new XPCollection<yourclassname>(uow); foreach ( var item in getRecords) // Do something with what you got in your XPCollection // Equivalent of SELECT * FROM TableName WHERE Id = 1 using ( var uow = new UnitOfWork()) XPCollection<yourclassname> getSpecificRecord = new XPCollection<yourclassname>(uow, CriteriaOperator.Parse( " Id = '1'" )); // OR YourClassName getSingleRec = new XPCollection<yourclassname>(uow, CriteriaOperator.Parse( " Id = '1'" )).FirstOrDefault(); // do something with single record from DB // Equivalent of SELECT * FROM Table WHERE FileName LIKE '%User%' using ( var uow = new UnitOfWork()) XPCollection<yourclassname> getRecords = new XPCollection<yourclassname>(uow, CriteriaOperator.Parse( " FileName LIKE '%user%'" )); foreach ( var item in getRecords) // do something with code // Equivalent of an Insert Statement in SQL using ( var uow = new UnitOfWork()) YourClassName save = new YourClassName(uow); save.FieldName = " I am a value to save to Database" ; save.Save(); uow.CommitChanges(); // .Save() will persistent your changes to the object but uow.CommitChanges() will save those changes back to the database // Equivalent of an Update statement in SQL using ( var uow = new UnitOfWork()) YourClassName update = uow.FindObject<yourclassname>(CriteriaOperator.Parse( " Id = '1'" )); update.FieldName = " Update To New Value" ; update.Save(); uow.CommitChanges(); </ yourclassname > </ yourclassname > </ yourclassname > </ yourclassname > </ yourclassname > </ yourclassname > </ yourclassname > </ yourclassname >
I'm not familiar with XAF and back when I answered this was the last time i really used XPO...i moved over to entity framework since so I'm afraid I can't be of much help.

Do you have the code behind in XAF you can share? I'm sure if you can access the code you can massage the answer into your XAF code.
  • Read the question carefully.
  • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.
  •