Can I override already existing anottation on . net?

Asked

Viewed 60 times

1

I have the following Annotation:

[XmlElement(IsNullable = true)]

I’d like to see the code behind it, so I can create my own based on it

Or if you can write her up

  • 2

    Just consider that the Annotation in itself should not possess the code that will actually set generate XML, it is only used by another object, such as the XmlSerializer which checks whether an attribute to be serialized is decorated with that XmlElementAttribute to execute a certain condition or other (in this case to serialize an attribute even if it is null). Therefore you should look in XmlSerializer.

2 answers

2

Resharper can break down the attribute code (as well as anything else) so you could see the attribute code.

You can also see the code of the same online.

1

With a plugin called . NET Reflector you can access the code of the Annotation and see how it is worked.

.NET Reflector

Browser other questions tagged

You are not signed in. Login or sign up in order to post.