Esempio n. 1
0
        public async Task TakeAndSaveAsync(IAggregateRoot aggregate)
        {
            var snapshot = aggregate.ToSnapshot();

            string insertScript = EventRepositoryScriptsAsStrings.InsertSnapshot();

            await _databaseProvider.ExecuteAsync(insertScript, snapshot);

            Log.Information($"Snapshot for aggregate {aggregate.GetType().Name} has been created from version {aggregate.Version}");
        }