0
Answer

NonSerialized property.

Giovanni

Giovanni

15y
6.6k
1
Hi all,
I'm coding a serializator using Reflection. Suppose I have the following simple class:

public class TestDataType
    {
        [NonSerialized]
        private string _name;

        public string Name { get { return _name; } set { _name = value; }
    }

How do I programmatically check that the value of the property Name has not to be serialized? It seems that PropertyInfo doesn't contain that information. Notice that the field _name is private so I can't even obtain the FieldInfo.

Hope for help.

Greetings.