mirror of
https://github.com/NexusForever/NexusForever
synced 2026-08-14 00:26:05 -04:00
23 lines
884 B
C#
23 lines
884 B
C#
using Microsoft.EntityFrameworkCore.Design;
|
|
using NexusForever.Database.Character;
|
|
using NexusForever.Database.Configuration;
|
|
using NexusForever.Shared.Configuration;
|
|
|
|
namespace NexusForever.WorldServer.Design
|
|
{
|
|
public class CharacterContextFactory : IDesignTimeDbContextFactory<CharacterContext>
|
|
{
|
|
public CharacterContext CreateDbContext(string[] args)
|
|
{
|
|
ConfigurationManager<WorldServerConfiguration>.Instance.Initialise("WorldServer.json");
|
|
return new CharacterContext(new DatabaseConfig
|
|
{
|
|
Character = new DatabaseConnectionString
|
|
{
|
|
Provider = DatabaseProvider.MySql,
|
|
ConnectionString = ConfigurationManager<WorldServerConfiguration>.Instance.Config.Database.Character.ConnectionString
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|