Approaches for generic, compile-time safe lazy-load methods
- by Aaronaught
Suppose I have created a wrapper class like the following:
public class Foo : IFoo
{
private readonly IFoo innerFoo;
public Foo(IFoo innerFoo)
{
this.innerFoo = innerFoo;
}
public int? Bar { get; set; }
public int? Baz { get; set; }
}
The idea here is that the innerFoo might wrap data-access methods or something…