mirror of
https://github.com/NexusForever/NexusForever
synced 2026-08-14 00:26:05 -04:00
Moved from database first to code first. Upgraded to EFCore 3.1. Upgraded to .NET Core 3.1.
22 lines
706 B
C#
22 lines
706 B
C#
using System;
|
|
|
|
namespace NexusForever.Database.Configuration
|
|
{
|
|
public class DatabaseConfig : IDatabaseConfig
|
|
{
|
|
public DatabaseConnectionString Auth { get; set; }
|
|
public DatabaseConnectionString Character { get; set; }
|
|
public DatabaseConnectionString World { get; set; }
|
|
|
|
public IConnectionString GetConnectionString(DatabaseType type)
|
|
{
|
|
return type switch
|
|
{
|
|
DatabaseType.Auth => Auth,
|
|
DatabaseType.Character => Character,
|
|
DatabaseType.World => World,
|
|
_ => throw new ArgumentException($"Invalid database type: {type:G}", nameof(type))
|
|
};
|
|
}
|
|
}
|
|
}
|