// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.TestUtilities; namespace EFCore.Jet.CustomBaseTests.GearsOfWarModel; public abstract class TPCGearsOfWarQueryRelationalFixture : GearsOfWarQueryFixtureBase { protected override string StoreName => "TPCGearsOfWarQueryTest"; public new RelationalTestStore TestStore => (RelationalTestStore)base.TestStore; public TestSqlLoggerFactory TestSqlLoggerFactory => (TestSqlLoggerFactory)ListLoggerFactory; protected override bool ShouldLogCategory(string logCategory) => logCategory == DbLoggerCategory.Query.Name; public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) => base.AddOptions(builder).ConfigureWarnings( w => w.Log(RelationalEventId.ForeignKeyTpcPrincipalWarning)); protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) { base.OnModelCreating(modelBuilder, context); modelBuilder.Entity().UseTpcMappingStrategy(); modelBuilder.Entity().UseTpcMappingStrategy(); modelBuilder.Entity().UseTpcMappingStrategy(); modelBuilder.Entity().ToTable("LocustHordes"); modelBuilder.Entity().ToTable("LocustCommanders"); } }