Quote:
B is the equivalent of PostedFile and C is the equivalent of FileContents so wouldn't doing a.Cs.Count force all the Cs to be loaded?
well, yes, but why count C's when counting B's offers the same result (B is 1-1 with C)?
Quote:
Plus, because a C belongs to B there is no way the A object can count the Cs without accessing the Bs (if that makes sense!!)?
makes perfect sense and that is true. counting Bs would leave C as a proxy and still give you the result you are looking for, the number of Cs (implied through the number of Bs) associated with an A.
Quote:
Do you count your PostedFile objects in code or using a SQL query?
that depends on the situation, but in most instances and counting with a A.Bs.Count property of the IList. in some cases we offer "show me all files over 100K" which forces us to do an SQL IQuery asking for the particluar fields thus avoiding the load of the file contents.
-devon