Calling generic method using reflection in .NET [duplicate]

You’re not using the result of MakeGenericMethod – which doesn’t change the method you call it on; it returns another object representing the constructed method. You should have something like:

method = method.MakeGenericMethod(typeof(SomeClass));
var result = method.Invoke(service, null);

(or use a different variable, of course).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)