Exemplo n.º 1
0
        public override Com.DigitalAsset.Ledger.Api.V1.Value ToProto()
        {
            var mb = new Com.DigitalAsset.Ledger.Api.V1.Map();

            foreach (var pair in Map)
            {
                mb.Entries.Add(new Com.DigitalAsset.Ledger.Api.V1.Map.Types.Entry {
                    Key = pair.Key, Value = pair.Value.ToProto()
                });
            }

            return(new Com.DigitalAsset.Ledger.Api.V1.Value {
                Map = mb
            });
        }
Exemplo n.º 2
0
        public static DamlTextMap FromProto(Com.DigitalAsset.Ledger.Api.V1.Map map)
        {
            var textMap = map.Entries.Aggregate(new Dictionary <string, Value>(), (s, p) => { s.Add(p.Key, Value.FromProto(p.Value)); return(s); });

            return(Of(textMap));
        }