Beispiel #1
0
 public IValue Serialize() =>
 new Dictionary(new Dictionary <IKey, IValue>
 {
     [(Text)"sellerAvatarAddress"] = SellerAvatarAddress.Serialize(),
     [(Text)"productId"]           = ProductId.Serialize(),
     [(Text)"itemUsable"]          = ItemUsable.Serialize(),
     [(Text)"price"] = Price.Serialize(),
 });
Beispiel #2
0
        public IValue Serialize()
        {
            var innerDictionary = new Dictionary <IKey, IValue>
            {
                [(Text)"sellerAgentAddress"]  = SellerAgentAddress.Serialize(),
                [(Text)"sellerAvatarAddress"] = SellerAvatarAddress.Serialize(),
                [(Text)"productId"]           = ProductId.Serialize(),
                [(Text)"price"] = Price.Serialize(),
            };

            if (ItemUsable != null)
            {
                innerDictionary.Add((Text)"itemUsable", ItemUsable.Serialize());
            }

            if (Costume != null)
            {
                innerDictionary.Add((Text)"costume", Costume.Serialize());
            }

            return(new Dictionary(innerDictionary));
        }