Behnam Esmaili Behnam Esmaili - 1 year ago 92
C# Question

Is Orchard contentManager `List()` identical to Linq Tolist()?

The question is, when I call

in a
(to Sql) query it fetches all the records from db and brings them into memory.and I wonder if
method of orchard ContentManager has same effect ?

Thanks in advance.

Answer Source

Yes. List() returns:

_query.Slice(0, 0).AsPart<T>()

Slice(0, 0) returns the whole result set as a read-only collection, and has the effect of executing the query and bringing the results into memory. AsPart<T>() presents the list of content items as a list of parts of type T.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download