As stated in the title I am asking if it's possible to define an attribute as a combination of an existing one. When I talk about an attribute I mean a class that inherits from System.Attribute.
I ask that because I found that a lot of my code looks like this :
[LibraryA_Attribute(string_param)]
[LibraryB_Attribute(int_param)]
public int MyProperty { get; set; }
I would like to not need to remember the list of attributes that I need to use every time, to decorate my POCO class, in order to get them managed correctly by the library I use. I would like to write something like this :
[MyAttribute(string_param,int_param)]
public int MyProperty { get; set; }
and let the compiler translate it properly.
My first thought is to implicit cast to convert MyAttribute to LibraryA_Attribute or LibraryB_Attribute but I'm not sure if it will work (plus it sounds risky). So I am asking for a suggestion.