예제 #1
0
        public async Task InsertOrReplaceCountry(CountryModel country)
        {
            await using var context = new DatabaseContext(_dbContextOptionsBuilder.Options);
            await context.UpsertAsync(new[] { country });

            await _cache.InsertOrReplaceAsync(KycCountryNoSqlEntity.Create(country));
        }
예제 #2
0
        public async Task RefreshCache()
        {
            await using var context = new DatabaseContext(_dbContextOptionsBuilder.Options);
            var countries = context.Countries.ToList();

            foreach (var country in countries)
            {
                await _cache.InsertOrReplaceAsync(KycCountryNoSqlEntity.Create(country));
            }
        }