![]() |
#2 |
Участник
|
Выполнил следующий код
X++: Entity entity = new Entity("test"); entity["moneyfield"] = new Money(new Decimal(123)); DataContractSerializer serializer = new DataContractSerializer(typeof(Entity), "entity", @"http://schemas.microsoft.com/xrm/2011/Contracts/Services"); MemoryStream ms = new MemoryStream(); StringWriter sw = new StringWriter(); using (XmlTextWriter writer = new XmlTextWriter(sw)) { writer.Formatting = Formatting.Indented; serializer.WriteObject(writer, entity); } string aaa = sw.ToString(); X++: <entity xmlns:d1p1="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services"> <d1p1:Attributes xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic"> <d1p1:KeyValuePairOfstringanyType> <d2p1:key>moneyfield</d2p1:key> <d2p1:value i:type="d1p1:Money"> <d1p1:Value>123</d1p1:Value> </d2p1:value> </d1p1:KeyValuePairOfstringanyType> </d1p1:Attributes> <d1p1:EntityState i:nil="true" /> <d1p1:FormattedValues xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> <d1p1:Id>00000000-0000-0000-0000-000000000000</d1p1:Id> <d1p1:LogicalName>test</d1p1:LogicalName> <d1p1:RelatedEntities xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> </entity> это Вам поможет. X++: <d1p1:KeyValuePairOfstringanyType>
<d2p1:key>moneyfield</d2p1:key>
<d2p1:value i:type="d1p1:Money">
<d1p1:Value>123</d1p1:Value>
</d2p1:value>
</d1p1:KeyValuePairOfstringanyType> Последний раз редактировалось g.Naukovych; 11.04.2012 в 15:55. |
|
|
За это сообщение автора поблагодарили: Kipetcoff (1). |
|
|