jeudi 28 mai 2015

Is it bad to have an empty attribute? (C#)

I have created an attribute which will define which properties have "special" data. My Attribute looks something like this:

[AttributeUsage(AttributeTargets.Property)]
    public class TestAttribute : Attribute
    {
    }

I don't need anything in the body of the class because all it's doing is identifying the properties. Is this bad practice? If so, what are better alternatives?

Thanks in advance!





Aucun commentaire:

Enregistrer un commentaire