1
This commit is contained in:
@@ -8,7 +8,8 @@ namespace BITKit
|
||||
{
|
||||
public static IEnumerable<Func<T>> CastAsFunc<T>(this Func<T> self)
|
||||
{
|
||||
return self is null ? Array.Empty<Func<T>>() : self?.GetInvocationList().Cast<Func<T>>();
|
||||
var value = self;
|
||||
return value is null? Array.Empty<Func<T>>() : self?.GetInvocationList().Cast<Func<T>>();
|
||||
}
|
||||
public static IEnumerable<Func<T0, T1>> CastAsFunc<T0, T1>(this Func<T0, T1> self)
|
||||
{
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -186,6 +187,10 @@ namespace BITKit
|
||||
self.Add(key, value);
|
||||
}
|
||||
}
|
||||
public static TValue Get<TKey,TValue>(this IDictionary<Type,TValue> self)
|
||||
{
|
||||
return self[typeof(TKey)];
|
||||
}
|
||||
public static TValue Get<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey key) where TValue : new()
|
||||
{
|
||||
lock (self)
|
||||
|
Reference in New Issue
Block a user