Пример #1
0
 public Promise <T> Where(Predicate <T> condition)
 {
     return(Then(t => {
         if (condition(t))
         {
             return Promises.Resolved(t);
         }
         else
         {
             return Promises.Disposed <T>();
         }
     }));
 }
Пример #2
0
 public Promise <U> Select <U>(Func <T, U> selector) where U : class
 {
     return(Then(t => Promises.Resolved(selector(t))));
 }