Lazy loading - what's the best approach?
问题 I have seen numerous examples of lazy loading - what's your choice? Given a model class for example: public class Person { private IList<Child> _children; public IList<Child> Children { get { if (_children == null) LoadChildren(); return _children; } } } The Person class should not know anything about how it's children are loaded .... or should it? Surely it should control when properties are populated, or not? Would you have a repository that couples a Person together with its children