Пример #1
0
        protected AggregateRootActor(AggregateRootCreationParameters parameters)
        {
            _id                = parameters.Id;
            _projections       = parameters.Projections;
            _snapshotThreshold = parameters.SnapshotThreshold;

            _log = Context.GetLogger();
        }
Пример #2
0
        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)"));
        }
Пример #3
0
 public Account(AggregateRootCreationParameters parameters)
     : base(parameters)
 {
     _state = new AccountState(this);
 }