in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Create an XPCollection result from a Linq query

Last post 12/14/2008 5:15 PM by Gary Cox. 1 replies.
Page 1 of 1 (2 items)
Sort Posts:
Previous Next
  • 11/7/2008 6:52 AM

    • Andrew
    • Top 200 Contributor
    • Joined on 7/3/2007
    • South Africa
    • Posts 59

    Create an XPCollection result from a Linq query

    HI,

    Has anyone tried to create an XPCollection<> result from a Linq to XPO query?

    I am trying to use Linq instead of the XPO criteria syntax (mainly because of the type safety it gives me) but linq queries return XPQuery objects and all my code works with XPCollections.

    On that note, are there any guidelines for using Linq to XPO? Best practices etc? The 1 page in the documentation is not particularly helpful...

    Thanks

    Andrew

  • 12/14/2008 5:15 PM In reply to

    Re: Create an XPCollection result from a Linq query

    I havent tried it but you might be able to perform your LINQ query and add to your XPCollection using the AddRange.  Just make sure your query returns the type you are loading into your collection and use the .ToArray() method when adding the range.

Page 1 of 1 (2 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED