IW4M-Admin/SharedLibrary/Database/Initializer.cs
RaidMax 8ce8db5f30 More EF Changes.
Added DB importer
2017-11-29 18:35:50 -06:00

43 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SharedLibrary.Database
{
public class Initializer : DropCreateDatabaseIfModelChanges<DatabaseContext>
{
protected override void Seed(DatabaseContext context)
{
var aliasLink = new Models.EFAliasLink();
var currentAlias = new Models.EFAlias()
{
Active = true,
DateAdded = DateTime.UtcNow,
IPAddress = "0.0.0.0",
Name = "IW4MAdmin",
Link = aliasLink
};
context.Clients.Add(new Models.EFClient()
{
Active = false,
Connections = 0,
FirstConnection = DateTime.UtcNow,
LastConnection = DateTime.UtcNow,
Level = Objects.Player.Permission.Console,
Masked = true,
NetworkId = "0000000000000000",
AliasLink = aliasLink,
CurrentAlias = currentAlias
});
base.Seed(context);
}
}
}