Tuesday, November 06, 2007

SubSonic - Using the Exist() Method using predicates

Here is a simple example on how to use the Exist() method that hangs of the collection entities generated by SubSonic.

for (int i = 0; i < originalentitycollection.Count; i++)
Predicate exist = delegate(Model.Person match)
if (match.PersonId == originalentitycollection[i].PersonId)
return true;
else return false;

if (!distinctpersoncollection.exists(exist))


You can visit MSDN for more information about the predicate delegates:

No comments:

Post a Comment