This commit is contained in:
2023-07-31 08:50:05 +03:00
parent cca943f37d
commit c5d9ae7b93
49 changed files with 546 additions and 398 deletions
+8 -1
View File
@@ -37,10 +37,17 @@ public class AppDbContextFactory : IDesignTimeDbContextFactory<AppDbContext>
throw new NotSupportedException($"No such provider: [{provider}]");
}
#if DEBUG
builder.EnableSensitiveDataLogging(true);
builder.EnableDetailedErrors(true);
#endif
var db = new AppDbContext(providerEnum, builder.Options);
db.ChangeTracker.AutoDetectChangesEnabled = false;
db.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
return db;
}
}
+2 -2
View File
@@ -60,7 +60,7 @@ public class RepositoryInitializer
/// </summary>
private static void UpdateCurrentRates(AppDbContext dbContext)
{
var lastrates = dbContext.CurrencyRates
var lastRates = dbContext.CurrencyRates
.Include(x => x.Currency)
.GroupBy(x => new
{
@@ -71,7 +71,7 @@ public class RepositoryInitializer
var currencies = dbContext.Currencies.ToList();
foreach (var currency in currencies)
{
var rate = lastrates.FirstOrDefault(x => x.CurrencyId == currency.Id);
var rate = lastRates.FirstOrDefault(x => x.CurrencyId == currency.Id);
if (rate != null)
{
currency.CurrentRateId = rate.Id;