Daniel
Daniel

Reputation: 6755

What's the difference between iterating over FindItemsResults and FindItemsResults.Items?

According to the documentation on MSDN, the FindItemsResults implements IEnumerable. It has a property called Items which implements ICollection. I can't find anywhere in the documentation whether the items in the collection are the same items that you would see when iterating over the FindItemsResults object, though. Are these items the same?

If they are, why does FindItemsResults even have the Items property? Why not just implement ICollection and not bother with the property?

Upvotes: 1

Views: 125

Answers (1)

Tim Francis
Tim Francis

Reputation: 96

This is common to have the [Items] property as an array or collection and then allow a simple way to access them using IEnumerable for EF queries.

FindItemsResults members Does say that Items is the result.

Upvotes: 1

Related Questions