Passing reference type parameters to Aspects

200 Views Asked by At

I have created an Aspect to handle database transactions. I wanted to pass a reference type object to this aspect. This object contains properties which tells about the connection status and connection details.( db name, connection open, transaction status etc).

I was able to pass parameters such as bool, int. But I was not able pass reference types, by which i can use the same instance of the object in the aspect as well.

Please suggest the way to procced.

Thank you

1

There are 1 best solutions below

2
On

I understand you want to pass a class or struct to a constructor argument of a custom attribute, or to assign a class or struct to a field or property of a custom attribute.

Unfortunately this is not possible because of limitations of custom attributes in .NET.