Ejemplo n.º 1
0
        public IChangeSet <TObject, TKey> Write(IChangeSet <TObject, TKey> changes)
        {
            if (changes == null)
            {
                throw new ArgumentNullException(nameof(changes));
            }
            IChangeSet <TObject, TKey> result;

            lock (_locker)
            {
                _updater.Update(changes);
                result = _updater.AsChangeSet();
            }
            return(result);
        }
Ejemplo n.º 2
0
        public Continuation <IChangeSet <TObject, TKey> > Write(IChangeSet <TObject, TKey> changes)
        {
            if (changes == null)
            {
                throw new ArgumentNullException(nameof(changes));
            }
            IChangeSet <TObject, TKey> result;

            lock (_locker)
            {
                try
                {
                    _updater.Update(changes);
                    result = _updater.AsChangeSet();
                }
                catch (Exception ex)
                {
                    return(new Continuation <IChangeSet <TObject, TKey> >(ex));
                }
            }
            return(new Continuation <IChangeSet <TObject, TKey> >(result));
        }