> Weird idea to issue 10k queries for retrieving 10k records.
Would do you mean "weird idea"? That's how lazy references work. Be careful what you are wishing for :)
var auditRecords = myLog.GetAudit(); // gets 10K audit records
foreach (var record in auditRecords) // loops 10K times { var user = record.User; // a lazy reference if (user.IsAdmin) ... // causes "user" to be instantiated from DB via query }
no subject
Date: 2015-10-02 02:56 pm (UTC)Would do you mean "weird idea"? That's how lazy references work. Be careful what you are wishing for :)
var auditRecords = myLog.GetAudit(); // gets 10K audit records
foreach (var record in auditRecords) // loops 10K times
{
var user = record.User; // a lazy reference
if (user.IsAdmin) ... // causes "user" to be instantiated from DB via query
}