Lazy loading - what's the best approach?

前端 未结 7 875
慢半拍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.

    0 讨论(0)
提交回复
热议问题