using IW4MAdmin.Plugins.Stats.Models; using Microsoft.EntityFrameworkCore; using SharedLibraryCore.Interfaces; namespace Stats.Models { public class ModelConfiguration : IModelConfiguration { public void Configure(ModelBuilder builder) { builder.Entity() .HasKey(cs => new { cs.ClientId, cs.ServerId }); // fix linking from SQLCe builder.Entity() .Property(c => c.EFClientStatisticsClientId) .HasColumnName("EFClientStatisticsClientId"); builder.Entity() .Property(c => c.EFClientStatisticsServerId) .HasColumnName("EFClientStatisticsServerId"); builder.Entity() .HasIndex(p => new { p.Performance, p.Ranking, p.When }); builder.Entity() .HasIndex(p => new { p.When, p.ServerId, p.Performance, p.ActivityAmount }); builder.Entity(message => { message.HasIndex(p => p.TimeSent); }); // force pluralization builder.Entity().ToTable("EFClientKills"); builder.Entity().ToTable("EFClientMessages"); builder.Entity().ToTable("EFClientStatistics"); builder.Entity().ToTable("EFHitLocationCounts"); builder.Entity().ToTable("EFServers"); builder.Entity().ToTable("EFServerStatistics"); } } }