Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface IFoo
- {
- Lazy<Task<int>> MyLazy { get; set; }
- }
- class Foo : IFoo
- {
- public Lazy<Task<int>> MyLazy { get; set; }
- public Foo()
- {
- MyLazy = new Lazy<Task<int>>(() => /*heavy operation*/ Task.FromResult(3));
- }
- }
- public Foo()
- {
- ((IFoo)this).MyLazy = new Lazy<Task<int>>(() => /*heavy operation*/ Task.FromResult(3));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement