public static void Main(string[] args) { var system = ActorSystem.Create("System"); var commandHandlerActor = system.ActorOf(Props.Create(() => new CommandHandlerActor()), "commandhandler"); var models = new List <DomainModel>(); var model = new DomainModel { Id = Guid.NewGuid(), Person = new Person { FirstName = "Steve", LastName = "Danger", ZipCode = "60607" } }; for (var i = 0; i < 100; i++) { models.Add(model); } foreach (var m in models) { var createPerson = new CreatePerson(m); commandHandlerActor.Tell(createPerson); } Console.Read(); }
public AggregateRoot(Guid id, DomainModel model) { Id = id; DomainModel = model; }
public CreatePerson(DomainModel model) { Model = model; }
public void Apply(PersonCreated @event) { DomainModel = @event.Model; }
public PersonCreated(DomainModel model, Guid aggregateId) : base(aggregateId) { Model = model; }