Add Application configuration #11

Merged
Wesser merged 128 commits from feat/add-setup into release/v1.0.0 2024-06-01 07:35:30 +03:00
4 changed files with 42 additions and 3 deletions
Showing only changes of commit 8cd8277c22 - Show all commits

View File

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<BaseOutputPath>..\..\Persistence\bin\</BaseOutputPath>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Persistence\Persistence.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<BaseOutputPath>..\..\Persistence\bin\</BaseOutputPath>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Persistence\Persistence.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<BaseOutputPath>..\..\Persistence\bin\</BaseOutputPath>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Persistence\Persistence.csproj" />
</ItemGroup>
</Project>

View File

@ -76,9 +76,12 @@ public static class DependencyInjection
{ {
return dbProvider switch return dbProvider switch
{ {
DatabaseProvider.Sqlite => options.UseSqlite(connection), DatabaseProvider.Mysql => options.UseMySql(connection, ServerVersion.AutoDetect(connection),
DatabaseProvider.Mysql => options.UseMySql(connection, ServerVersion.AutoDetect(connection)), x => x.MigrationsAssembly("MysqlMigrations")),
DatabaseProvider.Postgresql => options.UseNpgsql(connection), DatabaseProvider.Sqlite => options.UseSqlite(connection,
x => x.MigrationsAssembly("SqliteMigrations")),
DatabaseProvider.Postgresql => options.UseNpgsql(connection,
x => x.MigrationsAssembly("PsqlMigrations")),
_ => throw new ArgumentException("Unsupported database provider", Enum.GetName(dbProvider)) _ => throw new ArgumentException("Unsupported database provider", Enum.GetName(dbProvider))
}; };
} }