Implementations Of type - CSharp System.Reflection

CSharp examples for System.Reflection:Type

Description

Implementations Of type

Demo Code


using System.Reflection;
using System.Linq;
using System.Collections.Generic;
using System;//from   ww  w.  jav  a 2  s  .  c  o m

public class Main{
        public static List<Type> ImplementationsOf<T>(this Assembly assembly)
        {
            return assembly.GetTypes().Where(c => typeof(T).IsAssignableFrom(c)).ToList();
        }
}

Related Tutorials