private void CommutativeAdd(CRDT.Application.Commutative.Counter.G_CounterService sourceReplica, Guid replicaId, int value, List <CRDT.Application.Commutative.Counter.G_CounterService> downstreamReplicas) { sourceReplica.DownstreamAdd(value, replicaId); foreach (var downstreamReplica in downstreamReplicas) { downstreamReplica.DownstreamAdd(value, replicaId); } }
private Dictionary <Node, CRDT.Application.Commutative.Counter.G_CounterService> CreateCommutativeReplicas(List <Node> nodes) { var dictionary = new Dictionary <Node, CRDT.Application.Commutative.Counter.G_CounterService>(); foreach (var node in nodes) { var repository = new G_CounterRepository(); var service = new CRDT.Application.Commutative.Counter.G_CounterService(repository); dictionary.Add(node, service); } return(dictionary); }