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); } }
public static V AppdGetOrDefault <V>(this String key, Func <String, V> factory) { return(key.AppdContains() ? key.AppdGet <V>() : factory(key)); }