Exemple #1
0
        private void persist(Subscription[] requirements, SubscriptionRole subscriptionRole)
        {
            requirements.Each(x => {
                x.NodeName = _graph.Name;
                x.Role     = subscriptionRole;
            });

            var existing = _persistence.LoadSubscriptions(_graph.Name, subscriptionRole);
            var newReqs  = requirements.Where(x => !existing.Contains(x)).ToArray();

            newReqs.Each(x => x.Id = Guid.NewGuid());
            _persistence.Persist(newReqs);
        }