mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-09-13 05:47:33 -04:00
16 lines
535 B
C#
16 lines
535 B
C#
using Cleanuparr.Shared.Enums;
|
|
using Cleanuparr.Shared.Helpers;
|
|
|
|
namespace Cleanuparr.Persistence.Providers;
|
|
|
|
public static class DatabaseProviderFactory
|
|
{
|
|
public static IDatabaseProvider Current =>
|
|
DatabaseConfigProvider.Provider switch
|
|
{
|
|
DatabaseProvider.Sqlite => new SqliteDatabaseProvider(),
|
|
DatabaseProvider.Postgres => new PostgresDatabaseProvider(),
|
|
_ => throw new InvalidOperationException($"No provider registered for {DatabaseConfigProvider.Provider}."),
|
|
};
|
|
}
|