当前位置: 首页>>代码示例>>C#>>正文


C# ICommit类代码示例

本文整理汇总了C#中ICommit的典型用法代码示例。如果您正苦于以下问题:C# ICommit类的具体用法?C# ICommit怎么用?C# ICommit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ICommit类属于命名空间,在下文中一共展示了ICommit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PostCommit

 public override void PostCommit(ICommit committed)
 {
     if (committed != null)
     {
         _scheduler.ScheduleDispatch(committed);
     }
 }
开发者ID:ZoralLabs,项目名称:NEventStore,代码行数:7,代码来源:DispatchSchedulerPipelineHook.cs

示例2: ValidateCommitStamp

 private void ValidateCommitStamp(ICommit commit)
 {
     if (commit.CommitStamp.AddSeconds(-2) > CommitStampProcessed)
     {
         throw new Exception(string.Format("Commit {0} {1} marked with checkpoint can not be found", CommitIdProcessed, CommitStampProcessed));
     }
 }
开发者ID:mojamcpds,项目名称:NEventStore.Cqrs,代码行数:7,代码来源:Checkpoint.cs

示例3: Select

 public override ICommit Select(ICommit committed)
 {
     bool converted = false;
     var eventMessages = committed
         .Events
         .Select(eventMessage =>
         {
             object convert = Convert(eventMessage.Body);
             if (ReferenceEquals(convert, eventMessage.Body))
             {
                 return eventMessage;
             }
             converted = true;
             return new EventMessage { Headers = eventMessage.Headers, Body = convert };
         })
         .ToList();
     if (!converted)
     {
         return committed;
     }
     return new Commit(committed.BucketId,
         committed.StreamId,
         committed.StreamRevision,
         committed.CommitId,
         committed.CommitSequence,
         committed.CommitStamp,
         committed.CheckpointToken,
         committed.Headers,
         eventMessages);
 }
开发者ID:KoenWillemse,项目名称:NEventStore,代码行数:30,代码来源:EventUpconverterPipelineHook.cs

示例4: Dispatch

 public void Dispatch(ICommit commit)
 {
     foreach (var e in commit.Events.Select(x=>x.Body))
     {
         EventPublisher.Publish(e as IEvent);
     }
 }
开发者ID:Malkiat-Singh,项目名称:webApiAngular,代码行数:7,代码来源:FakeBusDispatcher.cs

示例5: Save

        public void Save(ICommit commit) {
            if (commit == null)
                throw new ArgumentNullException("commit");

            var id = Serializer.Serialize(commit.Id);
            var value = Serializer.Serialize(commit);

            using (var connection = DbConnectionFactory.CreateOpenConnection())
            using (var trans = connection.BeginTransaction(IsolationLevel.Serializable))
            using (var command = connection.CreateCommand()) {
                command.Transaction = trans;
                command.CommandText = "INSERT INTO SqlCommits (Id, Value) VALUES (@Id, @Value)";
                command.Parameters.Add(command.CreateParameter());
                command.Parameters[0].ParameterName = "Id";
                command.Parameters[0].Value = id;
                command.Parameters.Add(command.CreateParameter());
                command.Parameters[1].ParameterName = "Value";
                command.Parameters[1].Value = value;

                if (command.ExecuteNonQuery() == 0)
                    throw new InvalidOperationException("Failed to insert a row");

                trans.Commit();
            }
        }
开发者ID:rho24,项目名称:PocoDb,代码行数:25,代码来源:SqlServerCommitStore.cs

示例6: DispatchCommit

 public static void DispatchCommit(IPublisher bus, ICommit commit)
 {
     foreach (var @event in commit.Events)
     {
         bus.Publish(@event.Body);
     }
 }
开发者ID:NForza,项目名称:NEventStoreExample,代码行数:7,代码来源:DelegateDispatcher.cs

示例7: Apply

        public void Apply(ICommit commit) {
            foreach (var addObject in commit.AddedPocos) {
                Server.MetaStore.AddNew(addObject.Meta);
                Server.IndexManager.NotifyMetaChange(addObject.Meta);
            }

            foreach (var propertySet in commit.UpdatedPocos) {
                var meta = Server.MetaStore.GetWritable(propertySet.Key);
                foreach (var setProperty in propertySet) {
                    meta.Properties[setProperty.Property] = setProperty.Value;
                }

                Server.MetaStore.Update(meta);
            }

            foreach (var addToCollection in commit.CollectionAdditions) {
                var meta = Server.MetaStore.GetWritable(addToCollection.CollectionId);
                meta.Collection.Add(addToCollection.Value);

                Server.MetaStore.Update(meta);
            }

            foreach (var removeFromCollection in commit.CollectionRemovals) {
                var meta = Server.MetaStore.GetWritable(removeFromCollection.CollectionId);
                meta.Collection.Remove(removeFromCollection.Value);

                Server.MetaStore.Update(meta);
            }
        }
开发者ID:rho24,项目名称:PocoDb,代码行数:29,代码来源:CommitProcessor.cs

示例8: Dispatch

 public void Dispatch(ICommit commit)
 {
     foreach (var eventMessage in commit.Events)
     {
         var msg = (IMessage) eventMessage.Body;
         _bus.Publish(msg);
     }
 }
开发者ID:barissonmez,项目名称:nes-training,代码行数:8,代码来源:CommitsDispatcher.cs

示例9: ScheduleDispatch

 public override void ScheduleDispatch(ICommit commit)
 {
     if (!Started)
     {
         throw new InvalidOperationException(Messages.SchedulerNotStarted);
     }
     Logger.Info(Resources.SchedulingDelivery, commit.CommitId);
     _queue.Add(commit);
 }
开发者ID:ZoralLabs,项目名称:NEventStore,代码行数:9,代码来源:AsynchronousDispatchScheduler.cs

示例10: OnNext

        public void OnNext(ICommit value)
        {
            foreach (var ev in value.Events)
            {
                var @event = ConvertEventMessageToEvent(ev);

                Send(@event);
            }
        }
开发者ID:ScottIsaak,项目名称:eventstore,代码行数:9,代码来源:EventBus.cs

示例11: CommitModel

 public CommitModel(ICommit commit)
 {
     this.Sequence = commit.CommitSequence;
     this.CheckPoint = commit.CheckpointToken;
     this.Date = commit.CommitStamp;
     this.CommitId = commit.CommitId;
     this.Headers = commit.Headers;
     Events = commit.Events.ToList();
 }
开发者ID:ProximoSrl,项目名称:Jarvis.DocumentStore,代码行数:9,代码来源:EventStreamModel.cs

示例12: ScheduleDispatch

 public virtual void ScheduleDispatch(ICommit commit)
 {
     if (!Started)
     {
         throw new InvalidOperationException(Messages.SchedulerNotStarted);
     }
     DispatchImmediately(commit);
     MarkAsDispatched(commit);
 }
开发者ID:ncgonz,项目名称:NEventStore,代码行数:9,代码来源:SynchronousDispatchScheduler.cs

示例13: PostCommit

 public override void PostCommit(ICommit committed)
 {
     Logger.DebugFormat(
         "New commit {0} on tenant {1}",
         committed.CheckpointToken,
         TenantAccessor.Current.Id
     );
     Updater.Update();
 }
开发者ID:ProximoSrl,项目名称:Jarvis.DocumentStore,代码行数:9,代码来源:TriggerProjectionEngineHook.cs

示例14: Dispatch

 public void Dispatch(ICommit commit)
 {
     foreach (var header in commit.Headers)
     {
         if (header.Key.StartsWith("UndispatchedMessage."))
         {
             _bus.Send(header.Value);
         }
     }
 }
开发者ID:barissonmez,项目名称:nes-training,代码行数:10,代码来源:CommitsDispatcher.cs

示例15: Select

        public ICommit Select(ICommit committed)
        {
            var eventConversionRunner = _eventConversionRunnerFactory();

            foreach (var eventMessage in committed.Events)
            {
                eventMessage.Body = eventConversionRunner.Run(eventMessage.Body);
            }

            return committed;
        }
开发者ID:Valem,项目名称:NES,代码行数:11,代码来源:EventConverterPipelineHook.cs


注:本文中的ICommit类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。