My approach would be like this: var adultNoChildren = (from adult in adultList where!childList. Any(child => child. ParentID == adult.ID) select adult).ToList() This can also be done using the other LINQ Syntax, but I can never remember that :) (The nice thing about .
Any is that it stops as soon as it finds a result, so the entire child list is only traversed for adults with no children).
My approach would be like this: var adultNoChildren = (from adult in adultList where!childList. Any(child => child. ParentID == adult.ID) select adult).ToList(); This can also be done using the other LINQ Syntax, but I can never remember that :) (The nice thing about .
Any is that it stops as soon as it finds a result, so the entire child list is only traversed for adults with no children).
Thanks for all the responses (Anthony, Jake, LukeH). This is the best (minus the ToList) because of the use of the Any, which is probably better for performance. – Andre Jun 4 '10 at 0:03.
Var noKids = from adult in adultList join child in childList on adult. ID equals child. ParentID into g from item in g.DefaultIfEmpty() where item == null select adult.
Var noKids = adultList. Where(a =>!childList. Any(c => c.
ParentID == a. ID)).
Essentially just a translation of Michael Stum's answer from query comprehension syntax to fluent extension method syntax. – LukeH Jun 4 '10 at 0:03.
If the lists have any size at all, I have to recommend a solution involving GroupJoin, due to hashjoin costing n+m, versus where! Any costing n*m IEnumerable noKids = from adult in adultList join child in childList on adult. ID equals child.
ParentID into kids where!kids.Any() select adult; Or in method form IEnumerable noKids = adultList. GroupJoin( childList, adult => adult. ID, child => child.
ParentID, (adult, kids) => new {Dude = adult, AnyKids = kids.Any() }) . Where(x =>!x. AnyKids) .
Select(x => x. Dude); Lastly, is Liane really a dude?
Sorting features, filtering features, and navigation features for schema sets. Integration with the XML editor to enable navigation from the tree to the XML editor and vice versa. Improved features and functionalitiesXML Editor and XSLT debuggerMultiple customer requests and software updates were applied in the XML editor and in the XSLT debugger.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.