Beispiel #1
0
    public static async Task <TryValue <T> > TryGetValueLazyAsync <T>(this ConcurrentTypeSet <object> set)
    {
        Contracts.Requires.That(set != null);

        AsyncLazy <T> lazy;

        return(set.TryGetValue(out lazy) ? TryValue.New(await lazy) : TryValue.None <T>());
    }
Beispiel #2
0
    public static bool TryGetValueLazy <T>(this ConcurrentTypeSet <object> set, out T value)
    {
        Contracts.Requires.That(set != null);

        Lazy <T> lazy;
        bool     result = set.TryGetValue(out lazy);

        value = lazy.Value;
        return(result);
    }