I\'ve got a generic method:
Func, bool> CreateFunction()
where T
can be any number of diff
You could do something like
class Program
{
static void Main(string[] args)
{
Example>.IsDictionary();
Example>.IsDictionary();
Example>.IsDictionary();
Console.ReadKey();
}
}
public class Example
{
public static void IsDictionary()
{
if (typeof(T).GetInterface(typeof(IDictionary<,>).Name) != null || typeof(T).Name.Contains("IDictionary"))
{
Console.WriteLine("Is IDictionary");
}
else
{
Console.WriteLine("Not IDictionary");
}
}
}