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.
23 lines
849 B
C#
23 lines
849 B
C#
using Microsoft.EntityFrameworkCore.Design;
|
|
using NexusForever.Database.Auth;
|
|
using NexusForever.Database.Configuration;
|
|
using NexusForever.Shared.Configuration;
|
|
|
|
namespace NexusForever.WorldServer.Design
|
|
{
|
|
public class AuthContextFactory : IDesignTimeDbContextFactory<AuthContext>
|
|
{
|
|
public AuthContext CreateDbContext(string[] args)
|
|
{
|
|
ConfigurationManager<WorldServerConfiguration>.Instance.Initialise("WorldServer.json");
|
|
return new AuthContext(new DatabaseConfig
|
|
{
|
|
Auth = new DatabaseConnectionString
|
|
{
|
|
Provider = DatabaseProvider.MySql,
|
|
ConnectionString = ConfigurationManager<WorldServerConfiguration>.Instance.Config.Database.Auth.ConnectionString
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|