Skip to content

Commit

Permalink
Update db context factory to use AppDomain.CurrentDomain.BaseDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaioru committed Aug 6, 2022
1 parent 3f60d55 commit 69536bf
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Edelstein.Common.Gameplay\Edelstein.Common.Gameplay.csproj"/>
<ProjectReference Include="..\Edelstein.Common.Util.Serializers\Edelstein.Common.Util.Serializers.csproj"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class GameplayDbContextFactory : IDesignTimeDbContextFactory<GameplayDbCo
public GameplayDbContext CreateDbContext(string[] args)
{
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
.AddJsonFile("appsettings.json", true)
.AddJsonFile("appsettings.Development.json", true)
.Build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class AuthDbContextFactory : IDesignTimeDbContextFactory<AuthDbContext>
public AuthDbContext CreateDbContext(string[] args)
{
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
.AddJsonFile("appsettings.json", true)
.AddJsonFile("appsettings.Development.json", true)
.Build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\Common.targets"/>

<PropertyGroup>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\protocol\Edelstein.Protocol.Services.Auth\Edelstein.Protocol.Services.Auth.csproj"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\Common.targets"/>

<PropertyGroup>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Mapster" Version="7.3.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.7"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ServerDbContextFactory : IDesignTimeDbContextFactory<ServerDbContex
public ServerDbContext CreateDbContext(string[] args)
{
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
.AddJsonFile("appsettings.json", true)
.AddJsonFile("appsettings.Development.json", true)
.Build();
Expand Down

0 comments on commit 69536bf

Please sign in to comment.