c# - How to invoke a Custom Attribute using reflection? -
i have method in invoking methods of different classes @ run time using reflection, code below:
var assembly = system.reflection.assembly.getexecutingassembly(); string[] assemblyinfo = assembly.fullname.split(','); var controllertype = assembly.gettype(assemblyinfo[0] + ".class1"); var controllerobj = system.activator.createinstance(controllertype); var method = controllerobj.gettype().getmethod("method1"); object[] parameters = new object[] { "-someparameterobject-" }; var obj = method.invoke(controllerobj, parameters);
and each invoked method has custom attribute it's not getting invoked in reflection. e.g.
[readwrite] public object somemethodname(object param)
is there way in reflection custom attribute should invoked automatically method invocation?
Comments
Post a Comment