You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since serialization support has been dropped in version 7 some help needs to be provided.
For XML serialization a record XmlSerializableMoney will be provided for use in DTOs. It will be convertible to and from Money and will provide facilities to either create or modify XmlAttributeOverrides to pass to a XmlSerializer instance to reshape how the XmlSerializableMoney is XML serialized.
publicreadonlyrecordstructSerializableMoney(decimalAmount,CurrencyIsoCodeCurrency);publicrecordMoneyContainerDto([property:XmlAttribute(attributeName:"da_name")]stringName,[property:XmlElement(ElementName ="da_money")]SerializableMoneyMoney){publicMoneyContainerDto(): this(string.Empty,new SerializableMoney()){}}varoverrides=new XmlAttributeOverrides();
overrides.Add(typeof(SerializableMoney), new XmlAttributes
{
Xmlns = false,
XmlRoot =new XmlRootAttribute("money")});
overrides.Add(typeof(SerializableMoney),"Currency", new XmlAttributes
{
XmlElements = { new XmlElementAttribute("currency")}});
overrides.Add(typeof(SerializableMoney),"Amount", new XmlAttributes
{
XmlElements = { new XmlElementAttribute("amount")}});XmlSerializermcs=new XmlSerializer(typeof(MoneyContainerDto), overrides);
The text was updated successfully, but these errors were encountered:
Since serialization support has been dropped in version 7 some help needs to be provided.
For XML serialization a record
XmlSerializableMoney
will be provided for use in DTOs. It will be convertible to and fromMoney
and will provide facilities to either create or modifyXmlAttributeOverrides
to pass to aXmlSerializer
instance to reshape how theXmlSerializableMoney
is XML serialized.The text was updated successfully, but these errors were encountered: