示例#1
0
        public virtual void Passes_on_redundant_foreign_key()
        {
            var modelBuilder = base.CreateConventionalModelBuilder();

            modelBuilder.Entity <A>().HasOne <A>().WithOne().IsRequired().HasForeignKey <A>(a => a.Id).HasPrincipalKey <A>(b => b.Id);

            VerifyWarning(CoreResources.LogRedundantForeignKey(new TestLogger <LoggingDefinitions>()).GenerateMessage("{'Id'}", "A"), modelBuilder.Model, LogLevel.Warning);
        }