If I understand what you are asking, no.
All attributes do is attach meta data in the Common Intermediate Language (CIL) to a class, method or other block of code; it does not alter how the code is compiled to CIL. A part of this compiling is to "mangle" method names, adding the return type and the order and types of the parameters. For example,
public void MyMethodName(string p1)
might get compiled to something like
_MyMethodName__void_string
, while
public void MyMethodName(string p1, int p2)
public void MyMethodName(int p1, string p2)
might be compiled to
_MyMethodName__void_int_string
and
_MyMethodName__void_string_int
. This is how the Framework tells the difference between overloads and checks that parameters have the correct type. No attribute can change this behavior.
So if you want to change the parameter type, you cannot use attributes: they
MUST be changed in the source code. If you want
MyMethodName
to take several different types of parameters, you must create a different method call for each parameter type. Or, you can have a single method with a parameter of type
Object
, but that would mean having to do your type checking manually.