using LOC.Core.Model.PvpServer; namespace LOC.Website.Common.Contexts { using System.Data.Entity; using Core; using Core.GameServer; using Core.Model.Account; using Core.Model.GameServer; using Core.Model.Sales; using Core.Model.Server; using Core.Model.Server.GameServer.CaptureThePig.Stats; using Core.Model.Server.GameServer.Dominate.Stats; using Core.Model.Server.GameServer.MineKart; using Core.Model.Server.PvpServer; using Core.Model.Server.PvpServer.Clan; public class LocContext : DbContext { public DbSet Accounts { get; set; } public DbSet Bans { get; set; } public DbSet Unbans { get; set; } public DbSet Logins { get; set; } public DbSet IpAddresses { get; set; } public DbSet MacAddresses { get; set; } public DbSet Ranks { get; set; } public DbSet PvpSalesPackages { get; set; } public DbSet PvpClasses { get; set; } public DbSet BenefitItems { get; set; } public DbSet Weapons { get; set; } public DbSet Skills { get; set; } public DbSet Items { get; set; } public DbSet Pets { get; set; } public DbSet PetExtras { get; set; } public DbSet Servers { get; set; } public DbSet ServerHistory { get; set; } public DbSet ServerStatuses { get; set; } public DbSet Transactions { get; set; } public DbSet SalesPackages { get; set; } public DbSet PvpTransactions { get; set; } public DbSet DominatePlayerStats { get; set; } public DbSet CaptureThePigPlayerStats { get; set; } public DbSet GemTransactions { get; set; } public DbSet MineKarts { get; set; } public DbSet Clans { get; set; } public DbSet ClanRoles { get; set; } public DbSet ClanTerritories { get; set; } public DbSet Alliances { get; set; } public DbSet Wars { get; set; } public DbSet Fields { get; set; } public DbSet FieldOres { get; set; } public DbSet FieldMonsters { get; set; } public DbSet FishCatches { get; set; } public DbSet FilteredWords { get; set; } public DbSet Log { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity() .HasMany(x => x.DominateStats) .WithMany(); modelBuilder.Entity() .HasMany(x => x.IpAddresses) .WithMany(); modelBuilder.Entity() .HasMany(x => x.CaptureThePigStats) .WithRequired(); modelBuilder.Entity() .HasMany(x => x.MacAddresses) .WithMany(); modelBuilder.Entity() .HasOptional(x => x.Clan) .WithMany(x => x.Members); modelBuilder.Entity() .HasMany(x => x.Alliances) .WithMany(); modelBuilder.Entity() .HasMany(x => x.Wars) .WithMany(); modelBuilder.Entity() .HasMany(x => x.Territories) .WithRequired(x => x.Clan); } } }