Ejemplo n.º 1
0
 public void FromModel(ServiceAddressPoolModel model)
 {
     foreach (var kv in model.Buckets)
     {
         var bucket = new ServiceAddressBucket(kv.Key);
         bucket.FromModel(kv.Value);
         this._buckets.TryAdd(kv.Key, bucket);
     }
 }
Ejemplo n.º 2
0
        public ServiceAddressPoolModel ToModel()
        {
            var model = new ServiceAddressPoolModel();

            model.Buckets = new Dictionary <string, ServiceAddressBucketModel>();

            foreach (var kv in this._buckets)
            {
                var bucket = kv.Value.ToModel();

                model.Buckets.Add(kv.Key, bucket);
            }

            return(model);
        }