Ejemplo n.º 1
0
 public void Publish <TEvent>(IEnumerable <TEvent> events)
     where TEvent : IEvent <ISingleSignOnToken>
 {
     foreach (TEvent @event in events)
     {
         PublishedEvents.Add(@event);
     }
 }
Ejemplo n.º 2
0
        internal void Create(RegisterPerson cmd)
        {
            if (State.Version > 0)
            {
                if (State.Name == cmd.Name)
                {
                    return;
                }
                else
                {
                    throw DomainError.Named("PersonAlreadyRegistered", $"A person named {State.Name} is already registered with id {State.Id}");
                }
            }
            var e = new PersonRegistered()
            {
                Id = cmd.Id, Name = cmd.Name
            };

            Apply(e);
            PublishedEvents.Add(e);
        }
Ejemplo n.º 3
0
 public Task Publish <T>(T @event) where T : IEvent
 {
     PublishedEvents.Add(@event);
     return(Task.CompletedTask);
 }
Ejemplo n.º 4
0
 public void Publish <T>(T @event) where T : Event
 {
     PublishedEvents.Add(@event);
 }
Ejemplo n.º 5
0
 public void Publish <T>(T @event)
     where T : IEvent <ISingleSignOnToken>
 {
     PublishedEvents.Add(@event);
 }
Ejemplo n.º 6
0
 public Task Publish <T>(T @event, CancellationToken cancellationToken = default(CancellationToken)) where T : class, IEvent
 {
     PublishedEvents.Add(@event);
     return(Task.CompletedTask);
 }
Ejemplo n.º 7
0
 public Task PublishAsync <T>(T @event) where T : IEvent
 {
     PublishedEvents.Add(@event);
     return(Task.FromResult(0));
 }
Ejemplo n.º 8
0
 public void Publish <T>(T @event) where T : IEvent
 {
     PublishedEvents.Add(@event);
     //return Task.CompletedTask;
 }