public static TestAggregate FromEvents(IUtcTimeTimeSource timeSource, Guid?id, IEnumerable <Type> events) { var rootEvents = events.ToEvents(); rootEvents.Cast <AggregateRootEvent>().First().AggregateRootId = id ?? Guid.NewGuid(); return(new TestAggregate(timeSource, rootEvents)); }
//Yes empty. Id should be assigned by an action and it should be obvious that the aggregate in invalid until that happens protected AggregateRoot(IUtcTimeTimeSource timeSource) : base(Guid.Empty) { Contract.Assert(timeSource != null); Contract.Assert(typeof(TAggregateRootBaseEventInterface).IsInterface); TimeSource = timeSource; _eventHandlersEventDispatcher.Register().IgnoreUnhandled <IAggregateRootEvent>(); }
protected NestedComponent (IUtcTimeTimeSource timeSource, Action <TNestedComponentBaseEventClass> raiseEventThroughParent, IEventHandlerRegistrar <TNestedComponentBaseEventInterface> appliersRegistrar, bool registerEventAppliers) : base(timeSource, raiseEventThroughParent, appliersRegistrar, registerEventAppliers) { }
protected NestedEntity (IUtcTimeTimeSource timeSource, Action <TEntityBaseEventClass> raiseEventThroughParent, IEventHandlerRegistrar <TEntityBaseEventInterface> appliersRegistrar) : base(timeSource, raiseEventThroughParent, appliersRegistrar, registerEventAppliers: false) { RegisterEventAppliers() .For <TEntityCreatedEventInterface>(e => Id = IdGetterSetter.GetId(e)); }
protected SlavedNestedEntity (IUtcTimeTimeSource timeSource, Action <TEntityBaseEventClass> raiseEventThroughParent, IEventHandlerRegistrar <TEntityBaseEventInterface> appliersRegistrar) : base(timeSource, raiseEventThroughParent, appliersRegistrar, registerEventAppliers: false) { RegisterEventAppliers() .IgnoreUnhandled <TEntityBaseEventInterface>(); }
public EventStoreSession(IServiceBus bus, IEventStore store, ISingleContextUseGuard usageGuard, IUtcTimeTimeSource timeSource) { Contract.Requires(bus != null); Contract.Requires(store != null); Contract.Requires(usageGuard != null); Contract.Requires(timeSource != null); _usageGuard = usageGuard; _bus = bus; _store = store; TimeSource = timeSource ?? DateTimeNowTimeSource.Instance; }
internal Component(IUtcTimeTimeSource timeSource, Action <TComponentBaseEventClass> raiseEventThroughParent, IEventHandlerRegistrar <TComponentBaseEventInterface> appliersRegistrar, bool registerEventAppliers) { TimeSource = timeSource; _raiseEventThroughParent = raiseEventThroughParent; _eventHandlersEventDispatcher.Register() .IgnoreUnhandled <TComponentBaseEventInterface>(); if (registerEventAppliers) { appliersRegistrar .For <TComponentBaseEventInterface>(ApplyEvent); } }
void IEventStored.SetTimeSource(IUtcTimeTimeSource timeSource) { TimeSource = timeSource; }
public AccountManagementEventStoreSession(IServiceBus bus, IEventStore store, ISingleContextUseGuard usageGuard, IUtcTimeTimeSource timeSource) : base(bus, store, usageGuard, timeSource) { }
public AccountManagementEventStoreSession(IServiceBus bus, IEventStore store, ISingleContextUseGuard usageGuard, IUtcTimeTimeSource timeSource) : base(bus, store, usageGuard, timeSource) {}
public static TestAggregate FromEvents <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(IUtcTimeTimeSource timeSource, Guid?id = null) { return(FromEvents(timeSource, id, Seq.OfTypes <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>())); }
public static TestAggregate FromEvents <T1, T2, T3, T4, T5, T6, T7, T8>(IUtcTimeTimeSource timeSource, Guid?id = null) { return(FromEvents(timeSource, id, Seq.OfTypes <T1, T2, T3, T4, T5, T6, T7, T8>())); }
public static TestAggregate FromEvents(IUtcTimeTimeSource timeSource, params RootEvent[] events) { return(new TestAggregate(timeSource, events)); }
public TestAggregate(IUtcTimeTimeSource timeSource, params RootEvent[] events) : this(timeSource) { Contract.Requires(events.First() is IAggregateRootCreatedEvent); RaiseEvents(events); }
private TestAggregate(IUtcTimeTimeSource timeSource) : base(timeSource) { SetupAppliers(); }