Esempio n. 1
0
        private async Task <DifferentialChangeset> ExtractDifferentialChangeset(TId id, IOrderedEnumerable <HistoricalEvent> events)
        {
            var changesets = await _repository.GetAllAsync <Guid, HistoricalChangeset>(); // TODO: keep it there, include changesets in context

            var differentialChangeset = new DifferentialChangeset();

            differentialChangeset.EntityId       = id.ToString();
            differentialChangeset.EntityTypeName = events.First().EntityName;
            differentialChangeset.Changesets     = events.AggregateCombine(ExtractOneDifferentialChangeset <TEntity>);
            return(differentialChangeset);
        }