Beispiel #1
0
        public static DamlGenMap FromProto(Com.DigitalAsset.Ledger.Api.V1.GenMap map)
        {
            var genMap = map.Entries.Aggregate(new Dictionary <Value, Value>(), (s, p) =>
            {
                s.Add(Value.FromProto(p.Key), Value.FromProto(p.Value));
                return(s);
            });

            return(Of(genMap));
        }
Beispiel #2
0
        public override Com.DigitalAsset.Ledger.Api.V1.Value ToProto()
        {
            var mb = new Com.DigitalAsset.Ledger.Api.V1.GenMap();

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

            return(new Com.DigitalAsset.Ledger.Api.V1.Value {
                GenMap = mb
            });
        }