public async Task ClearGames()
{
_logger.LogDebug("ClearGames called");
using (var context = await _dbContextFactory.CreateDbContextAsync())
{
_logger.LogDebug("Truncating games table...");
try
{
await context.TruncateAsync<DbGame>();
await context.SaveChangesAsync();
} catch (Exception e)
{
_logger.LogError("{error}", e);
throw;
}
_logger.LogDebug("Truncate finished");
}
}
public async Task ClearGames()
{
_logger.LogDebug("ClearGames called");
using (var context = await _dbContextFactory.CreateDbContextAsync())
{
_logger.LogDebug("Truncating games table...");
try
{
await context.TruncateAsync<DbGame>();
await context.SaveChangesAsync();
} catch (Exception e)
{
_logger.LogError("{error}", e);
throw;
}
_logger.LogDebug("Truncate finished");
}
}