• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ICommit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: PostCommit

        public override void PostCommit(ICommit committed)
        {
            if (!committed.Headers.ContainsKey("AggregateType"))
                return;

            var type = (string)committed.Headers["AggregateType"];
            if (type != DocumentTypeName)
                return;

            HandleDocumentCreation(committed);
        }
开发者ID:ProximoSrl,项目名称:Jarvis.DocumentStore,代码行数:11,代码来源:ReadModelPromisesHook.cs


示例17: MarkAsDispatched

 private void MarkAsDispatched(ICommit commit)
 {
     try
     {
         Logger.Info(Resources.MarkingCommitAsDispatched, commit.CommitId);
         _persistence.MarkCommitAsDispatched(commit);
     }
     catch (ObjectDisposedException)
     {
         Logger.Warn(Resources.UnableToMarkDispatched, commit.CommitId);
     }
 }
开发者ID:rikbosch,项目名称:NEventStore,代码行数:12,代码来源:SynchronousDispatchScheduler.cs


示例18: Dispatch

        public void Dispatch(ICommit commit)
        {
            foreach (var @event in commit.Events.Where(x => x.Body is IDomainEvent))
            {
                var tmp = @event;

                this.Info(() => string.Format("Attempting to dispatch event: {0}", tmp));

                _bus.Publish(@event.Body);

                this.Info(() => string.Format("Successfully dispatched event: {0}", tmp));                
            }
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:13,代码来源:InMemoryDispatcher.cs


示例19: DispatchImmediately

 private void DispatchImmediately(ICommit commit)
 {
     try
     {
         Logger.Info(Resources.SchedulingDispatch, commit.CommitId);
         _dispatcher.Dispatch(commit);
     }
     catch
     {
         Logger.Error(Resources.UnableToDispatch, _dispatcher.GetType(), commit.CommitId);
         throw;
     }
 }
开发者ID:ncgonz,项目名称:NEventStore,代码行数:13,代码来源:SynchronousDispatchScheduler.cs


示例20: Set

 public void Set(ICommit commit)
 {
     if (commit == null)
     {
         CommitIdProcessed = null;
         CommitStampProcessed = null;
     }
     else
     {
         CommitIdProcessed = commit.CommitId;
         CommitStampProcessed = commit.CommitStamp;
     }
 }
开发者ID:mojamcpds,项目名称:NEventStore.Cqrs,代码行数:13,代码来源:Checkpoint.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ICommonServices类代码示例发布时间:2022-05-24
下一篇:
C# ICommentService类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap