public void Test() { _aggregate = new SampleAggregate(Guid.NewGuid(), "test"); _aggregate.ChangeState(10); _aggregate.ClearEvents(); var jsonString = JsonConvert.SerializeObject(_aggregate, DomainSerializer.GetDefaultSettings()); _restoredAggregate = JsonConvert.DeserializeObject <SampleAggregate>(jsonString, DomainSerializer.GetDefaultSettings()); }
public void Test() { _aggregate = new SampleAggregate(Guid.NewGuid(), "test"); _aggregate.ChangeState(10); _aggregate.ClearEvents(); var repo = new AggregateSnapshotRepository(AkkaConf.Persistence.JournalConnectionString, GridNode.AggregateFromSnapshotsFactory); repo.Add(_aggregate); _restoredAggregate = LoadAggregate <SampleAggregate>(_aggregate.Id); }