Esempio n. 1
0
        public static OnDemand <int> AddOne(OnDemand <int> onDemand)
        {
            var unwrapped = onDemand._func();
            var result    = unwrapped + 1;

            return(Create(result));
        }
Esempio n. 2
0
 public static OnDemand <int> AddOneCorrect(OnDemand <int> onDemand)
 {
     return(new OnDemand <int>(() =>
     {
         int unwrapped = onDemand.Value;
         int result = unwrapped + 1;
         return result;
     }));
 }