protected AggregateRootActor(AggregateRootCreationParameters parameters) { _id = parameters.Id; _projections = parameters.Projections; _snapshotThreshold = parameters.SnapshotThreshold; _log = Context.GetLogger(); }
public static IActorRef AccountAggregate(this ActorSystem system, Guid id, int snapshotThreshold = 250) { var projectionsProps = new ConsistentHashingPool(5).Props(Props.Create <ReadModelProjections>()); var projections = system.ActorOf(projectionsProps, SystemData.ProjectionsActor.Name); var creationParams = new AggregateRootCreationParameters(id, projections, snapshotThreshold); return(system.ActorOf(Props.Create <Account>(creationParams), "aggregates(account)")); }
public Account(AggregateRootCreationParameters parameters) : base(parameters) { _state = new AccountState(this); }