コード例 #1
0
 public static V AppdGetOrCreate <V>(this String key, Func <String, V> factory)
 {
     if (key.AppdContains())
     {
         return(key.AppdGet <V>());
     }
     else
     {
         var created = factory(key);
         key.AppdSet(created);
         return(created);
     }
 }
コード例 #2
0
 public static V AppdGetOrDefault <V>(this String key, Func <String, V> factory)
 {
     return(key.AppdContains() ? key.AppdGet <V>() : factory(key));
 }