private TState CreateState(byte detalizationLevel, out List <ulong> versions, out int mutationCount)
        {
            var snapshot  = repo.GetLastSnapshot <TState>(Resource, out versions);
            var mutations = repo.GetEvents(Resource, detalizationLevel, versions);

            mutationCount = mutations.Count;
            foreach (var mutation in mutations)
            {
                snapshot = ApplyMutation(snapshot, mutation, detalizationLevel, ref versions);
            }

            return(snapshot);
        }
Exemple #2
0
        private TState CreateState(out ulong version, out int mutationCount)
        {
            var snapshot  = repo.GetLastSnapshot <TState>(Resource, out version);
            var mutations = repo.GetEvents(Resource, version);

            mutationCount = mutations.Count;
            foreach (var mutation in mutations)
            {
                snapshot = ApplyMutation(snapshot, mutation, ref version);
            }

            return(snapshot);
        }