回答:
TcKからの回答を使用することで、次のLINQクエリでも実行できます。
bool isBar = foo.GetType().GetInterfaces().Any(x =>
  x.IsGenericType &&
  x.GetGenericTypeDefinition() == typeof(IBar<>));typeof(IBar<,,,>)ます:コンマをプレースホルダーのように機能させる
                    継承ツリーを上に移動して、ツリー内の各クラスのすべてのインターフェースを見つけ、インターフェースが汎用である場合typeof(IBar<>)は呼び出しの結果と比較するType.GetGenericTypeDefinition 必要があります。それは確かに少し苦痛です。
public interface IFoo<T> : IBar<T> {}
public class Foo : IFoo<Foo> {}
var implementedInterfaces = typeof( Foo ).GetInterfaces();
foreach( var interfaceType in implementedInterfaces ) {
    if ( false == interfaceType.IsGeneric ) { continue; }
    var genericType = interfaceType.GetGenericTypeDefinition();
    if ( genericType == typeof( IFoo<> ) ) {
        // do something !
        break;
    }
}ヘルパーメソッド拡張として
public static bool Implements<I>(this Type type, I @interface) where I : class
{
    if(((@interface as Type)==null) || !(@interface as Type).IsInterface)
        throw new ArgumentException("Only interfaces can be 'implemented'.");
    return (@interface as Type).IsAssignableFrom(type);
}使用例:
var testObject = new Dictionary<int, object>();
result = testObject.GetType().Implements(typeof(IDictionary<int, object>)); // true!@GenericProgrammers拡張メソッドの少し単純なバージョンを使用しています。
public static bool Implements<TInterface>(this Type type) where TInterface : class {
    var interfaceType = typeof(TInterface);
    if (!interfaceType.IsInterface)
        throw new InvalidOperationException("Only interfaces can be implemented.");
    return (interfaceType.IsAssignableFrom(type));
}使用法:
    if (!featureType.Implements<IFeature>())
        throw new InvalidCastException();完全型システムに取り組むために、私は例えば、あなたは再帰を処理する必要があると思うIList<T>:ICollection<T>:IEnumerable<T>、それなしあなたがそれを知っているではないでしょうIList<int>、最終的に実装しますIEnumerable<>。
    /// <summary>Determines whether a type, like IList<int>, implements an open generic interface, like
    /// IEnumerable<>. Note that this only checks against *interfaces*.</summary>
    /// <param name="candidateType">The type to check.</param>
    /// <param name="openGenericInterfaceType">The open generic type which it may impelement</param>
    /// <returns>Whether the candidate type implements the open interface.</returns>
    public static bool ImplementsOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType)
    {
        Contract.Requires(candidateType != null);
        Contract.Requires(openGenericInterfaceType != null);
        return
            candidateType.Equals(openGenericInterfaceType) ||
            (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) ||
            candidateType.GetInterfaces().Any(i => i.IsGenericType && i.ImplementsOpenGenericInterface(openGenericInterfaceType));
    }ジェネリックベースタイプとインターフェイスをサポートする拡張メソッドが必要な場合は、sduplooyの答えを拡張しました。
    public static bool InheritsFrom(this Type t1, Type t2)
    {
        if (null == t1 || null == t2)
            return false;
        if (null != t1.BaseType &&
            t1.BaseType.IsGenericType &&
            t1.BaseType.GetGenericTypeDefinition() == t2)
        {
            return true;
        }
        if (InheritsFrom(t1.BaseType, t2))
            return true;
        return
            (t2.IsAssignableFrom(t1) && t1 != t2)
            ||
            t1.GetInterfaces().Any(x =>
              x.IsGenericType &&
              x.GetGenericTypeDefinition() == t2);
    }型がジェネリック型を継承または実装しているかどうかを確認するメソッド:
   public static bool IsTheGenericType(this Type candidateType, Type genericType)
    {
        return
            candidateType != null && genericType != null &&
            (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition() == genericType ||
             candidateType.GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == genericType) ||
             candidateType.BaseType != null && candidateType.BaseType.IsTheGenericType(genericType));
    }次の拡張機能を試してください。
public static bool Implements(this Type @this, Type @interface)
{
    if (@this == null || @interface == null) return false;
    return @interface.GenericTypeArguments.Length>0
        ? @interface.IsAssignableFrom(@this)
        : @this.GetInterfaces().Any(c => c.Name == @interface.Name);
}それをテストする。つくる
public interface IFoo { }
public interface IFoo<T> : IFoo { }
public interface IFoo<T, M> : IFoo<T> { }
public class Foo : IFoo { }
public class Foo<T> : IFoo { }
public class Foo<T, M> : IFoo<T> { }
public class FooInt : IFoo<int> { }
public class FooStringInt : IFoo<string, int> { }
public class Foo2 : Foo { }そしてテスト方法
public void Test()
{
    Console.WriteLine(typeof(Foo).Implements(typeof(IFoo)));
    Console.WriteLine(typeof(FooInt).Implements(typeof(IFoo)));
    Console.WriteLine(typeof(FooInt).Implements(typeof(IFoo<>)));
    Console.WriteLine(typeof(FooInt).Implements(typeof(IFoo<int>)));
    Console.WriteLine(typeof(FooInt).Implements(typeof(IFoo<string>)));
    Console.WriteLine(typeof(FooInt).Implements(typeof(IFoo<,>)));
    Console.WriteLine(typeof(FooStringInt).Implements(typeof(IFoo<,>)));
    Console.WriteLine(typeof(FooStringInt).Implements(typeof(IFoo<string,int>)));
    Console.WriteLine(typeof(Foo<int,string>).Implements(typeof(IFoo<string>)));
 }以下に問題はありません。
bool implementsGeneric = (anObject.Implements("IBar`1") != null);IBarクエリで特定のジェネリック型パラメーターを提供する場合は、追加のクレジットとしてAmbiguousMatchExceptionをキャッチできます。
bool implementsGeneric = (anObject.Implements(typeof(IBar<>).Name) != null);