fix timestamps in databaseImplementation

This commit is contained in:
DavidMakarov 2024-05-17 00:53:09 +04:00
parent 32485b08e4
commit 68e542bce8

View File

@ -12,6 +12,9 @@ namespace FlowerShopDatabaseImplement
optionsBuilder.UseNpgsql(@"Host=localhost;Database=FlowerShopHardDatabaseTestFull;Username=postgres;Password=postgres");
}
base.OnConfiguring(optionsBuilder);
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
}
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Flower> Flowers { set; get; }