Compare commits
3 Commits
81508a81fd
...
2390272b69
Author | SHA1 | Date | |
---|---|---|---|
2390272b69 | |||
a851373a8b | |||
6f95297544 |
24
CarCenter/CarCenterDatabaseImplement/CarCenterDatabase.cs
Normal file
24
CarCenter/CarCenterDatabaseImplement/CarCenterDatabase.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarCenterDatabaseImplement
|
||||
{
|
||||
public class CarCenterDatabase : DbContext
|
||||
{
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
optionsBuilder.UseNpgsql(@"Host=localhost;Database=CarCenterDatabaseFull;Username=postgres;Password=postgres");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
||||
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -11,6 +11,15 @@
|
||||
<Folder Include="Implements\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.29" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.29">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.22" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CarCenterContracts\CarCenterContracts.csproj" />
|
||||
<ProjectReference Include="..\CarCenterDataModels\CarCenterDataModels.csproj" />
|
||||
|
Loading…
Reference in New Issue
Block a user