this is a dummy example what I am trying to do:
var ass = Assembly.Load("Dummy.Class.FullName");
var yy =
from t in ass.GetTypes()
let attributes = t.GetCustomAttributes(typeof(MyTestAttribute), true)
where attributes != null && attributes.Length > 0
select new { Type = t, Attributes = attributes.Cast<MyTestAttribute>() };
foreach (var x in yy)
{
TestOpen<typeof(x.Type)>();
}
private void TestOpen<TEntity>() where TEntity : Entity, new()
{
}
I can´t get a class definition and pass to a generic method this way, I tried everything, I guess I am missing something in special that the method is waiting some compiled class and from reflection I can´t get this, correct?
cheers
You can use MakeGenericMethod to generate the proper method definition, and call it via reflection.