示例#1
0
        public void Save(IEnumerable <IRelation> relations)
        {
            using (ICoreScope scope = ScopeProvider.CreateCoreScope())
            {
                IRelation[] relationsA = relations.ToArray();

                EventMessages messages           = EventMessagesFactory.Get();
                var           savingNotification = new RelationSavingNotification(relationsA, messages);
                if (scope.Notifications.PublishCancelable(savingNotification))
                {
                    scope.Complete();
                    return;
                }

                _relationRepository.Save(relationsA);
                scope.Complete();
                scope.Notifications.Publish(new RelationSavedNotification(relationsA, messages).WithStateFrom(savingNotification));
            }
        }