SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. interface IFoo
  2. {
  3.      Lazy<Task<int>> MyLazy { get;   set; }
  4.  
  5. }
  6.  
  7. class Foo : IFoo
  8. {
  9.     public Lazy<Task<int>> MyLazy { get;    set; }
  10.  
  11.     public Foo()
  12.     {
  13.         MyLazy = new Lazy<Task<int>>(() => /*heavy operation*/ Task.FromResult(3));
  14.     }
  15.  
  16. }
  17.      
  18. public Foo()
  19. {
  20.     ((IFoo)this).MyLazy = new Lazy<Task<int>>(() => /*heavy operation*/ Task.FromResult(3));
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top