I have a class called SerializableStringthat extends the base class CustomXmlSerializable. The base class provides methods for serializing and deserializing an XML derived class.
public class SerializableString : CustomXmlSerializable
{
public string String { get; set; }
}
Obviously, I can call the property stringanything. But since this class is so general in nature, it would be nice to give it a very obvious name, such as "String". Thus, the property can be obtained as:
SerializableString userName = new SerializableString();
userName.String = "khargoosh";
This allows the compiler. Regardless of the nature of the class and ownership, would it be bad practice or dangerous to give one and only property in a class named "String"?