You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
EntityFrameworkCore.Jet/test/EFCore.Jet.CustomBaseTests/GearsOfWarModel/TPCGearsOfWarQueryRelationa...

41 lines
1.5 KiB
C#

// 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<Gear>().UseTpcMappingStrategy();
modelBuilder.Entity<Faction>().UseTpcMappingStrategy();
modelBuilder.Entity<LocustLeader>().UseTpcMappingStrategy();
modelBuilder.Entity<LocustHorde>().ToTable("LocustHordes");
modelBuilder.Entity<LocustCommander>().ToTable("LocustCommanders");
}
}