XPO and LINQ - first steps

XPO Team Blog
22 November 2006

The version of XPO included in our new DXperience 6.3 release includes our first shot at support for LINQ – unsupported and most probably buggy, I should add.

To try it yourself, you must make sure you’re using the correct version of LINQ, or of System.Query.dll to be more precise. The version you need is included in the August 2006 CTP of ADO.NET vNext, and to install that, you’ll need to have the LINQ May 2006 CTP installed first. When creating a project, be sure to reference the System.Query.dll that is part of ADO.NET vNext – the GAC will still contain a reference to the LINQ CTP one, and the Visual Studio templates in the LINQ Preview category also reference the wrong version. There are templates in Visual Studio that you can use, in the category ADO.NET vNext CTP – whichever way you go, you should make sure that the referenced System.Query.dll is in the ADO.NET vNext CTP installation directory, by default at C:\Program Files\Microsoft SDKs\ADO.NET vNext CTP\Bin\System.Query.dll.

Now, in addition to the standard assemblies required for XPO, you must add a reference to the assembly DevExpress.Xpo.v6.3.Query.dll. This can be found in the GAC, but it’s shown as DevExpress.Xpo.Linq, confusingly. There’s only one of those around, so once you find it, you should be fine :-)

With all that in place, you should now be able to write code like this:

using (UnitOfWork unitOfWork = new UnitOfWork()) {
  var albums = 
    from album in new XPQuery<Album>(unitOfWork)
      where album.Year == 1974
      select album;
  ...
}

Let me repeat, this is currently in development. Feel free to let us know if you encounter really unexpected or inexplicable behaviour, but that is to be expected at this point. Have fun with this early preview!

Tags
4 comment(s)
Anonymous
XPO
Well, Oliver has taken the lead over me announcing the LINQ support in his message.  Hopefully, the community...
27 November, 2006
Alex Hoffman
Alex Hoffman

LINQ support seems to be broken in VS2008 beta 2 with DevExpress 7.2.2.

Are you intending to update LINQ support?

5 August, 2007
Oliver Sturm (DevExpress)
Oliver Sturm (DevExpress)

Hey Alex

Of course we will update our LINQ support. I can't tell you anything more at this time because the dev who's working on that is currently on vacation, but I'm sure it'll come soon.

7 August, 2007
Anonymous
XPO

Well, Oliver has taken the lead over me announcing the LINQ support in his message . Hopefully, the community

28 March, 2008

Please login or register to post comments.