Entity Framework and the XmlIgnoreAttribute
- by Mikey Cee
Say you have a one to one relationship in your entity model. The code generator will decorate it with the following attributes:
[global::System.Xml.Serialization.XmlIgnoreAttribute()]
[global::System.Xml.Serialization.SoapIgnoreAttribute()]
public RelatedObject Relationship { get {...} set {...} }
I want to serialize my parent object together with all its properties for which data has been loaded through an XML web service. Obviously, these related properties do not get serialized because of these attributes.
So for my purposes I just want to remove these "don't serialize me" attributes. I can do a find and replace in the designer code, but any modifications I make in the designer will put these attributes back in.
How do I permanently get rid of these attributes?
VS 2008 / EF 3.5.