Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LINQ to Objects Subquery ?
Message
From
04/09/2009 05:32:25
 
 
To
03/09/2009 23:32:06
General information
Forum:
ASP.NET
Category:
LINQ
Environment versions
Environment:
VB 9.0
OS:
Vista
Miscellaneous
Thread ID:
01422566
Message ID:
01422604
Views:
56
>I am the newest of Linq newbies so feel free to speak slowly and use small words <bg>
>
>I have list of integers.
>
>I have a business object of strongly type properties.
>( the bo implements ienumerable through one of its own functions but if I can't get that to work I can convert the data to an array or some other object that implement the interface in a standard way. The bos also expose all standard ado properties re datatable, currentview etc if that helps)
>
>There are properties
>
>ikey,description, itemplateskey
>
>I want to select the bo.ikey where itemplateskey is not in the list of integers.
>
>(corallaries would includes selecting all records from one bo where some value in that bo is found or not found in some field in another bo )
>
>I think I've stripped down the problem to the essentials. Any help on linq subquery syntax with be appreciated as I think that is probably going to be the most elegant solution for a lot of this kind of stuff
>
>TIA

I'm not clear on whether you have a collection of business objects or whether the BO contains a collection of objects. If the former then something like:
var v = from x in lbo where !myInts.Contains(x.itemplateskey) select x;
should return all objects whose itemplateskey is not in the int list (where lbo is the collection of objects and myInts is the collection of ints.). If the latter then something similar....
Previous
Reply
Map
View

Click here to load this message in the networking platform