Lazy loading - what's the best approach?

前端 未结 7 873
慢半拍i
慢半拍i 2020-12-31 07:22

I have seen numerous examples of lazy loading - what\'s your choice?

Given a model class for example:

public class Person
{
    private IList

        
7条回答
  •  囚心锁ツ
    2020-12-31 07:54

    I'm thinking that this is precisely the kind of problem that is best handled by AOP (e.g., PostSharp). Have your lazy loading as an aspect and then use it to decorate whatever property you want to be loaded lazily. Disclaimer: haven't tried it; just thinking that it should work.

提交回复
热议问题