当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - Can I customize how a property is serialized to xml within a partial class?

问题描述:

I have a set of entities that are generated by the EF Reverse POCO Generator. Using the Audit Log feature of EntityFramework.Extended I can serialize changes to my entities to Xml except when the entity has a property of type DbGeography. In Reverse POCO, I've set the option DisableGeographyTypes=true so this property no longer gets generated and I've added a partial (non-generated) class and put the property in there instead.

Is there an attribute I can add to this property that will allow me to customize how it gets serialized to XML? Something like [SomeXmlAttribute(MyCustomSerializer)] where MyCustomSerializer is a class that will allow me to convert the data type to and from Xml?

分享给朋友:
您可能感兴趣的文章:
随机阅读: