mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-23 15:14:49 +01:00
Minor refactoring (#6939)
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
||||
using BTCPayServer.Abstractions.Contracts;
|
||||
using BTCPayServer.Abstractions.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure;
|
||||
@@ -22,6 +23,11 @@ namespace BTCPayServer.Data
|
||||
var builder = new DbContextOptionsBuilder<ApplicationDbContext>();
|
||||
builder.UseLoggerFactory(LoggerFactory);
|
||||
builder.AddInterceptors(MigrationInterceptor.Instance);
|
||||
builder.ConfigureWarnings(w =>
|
||||
{
|
||||
w.Log((CoreEventId.OptimisticConcurrencyException, LogLevel.Debug));
|
||||
w.Log((CoreEventId.SaveChangesFailed, LogLevel.Debug));
|
||||
});
|
||||
ConfigureBuilder(builder, npgsqlOptionsAction);
|
||||
return new ApplicationDbContext(builder.Options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user