I have Interface
with Generic Type
public interface IWork<T>
{
void Work(MySession session, T json);
}
I am trying to find all Classes
that implement the Interface
with all generic types, when trying this code
var type = typeof(IWork<>);
var types = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(s => s.GetTypes())
.Where(p => type.IsAssignableFrom(p));
Its return the Interface
it self.
Aucun commentaire:
Enregistrer un commentaire