You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EntitySplittingMissingPropertiesMainFragment does not take owned navigations/complex properties into account #36171
We have a model validation check to make sure that the main table has at least one non-key property on it (EntitySplittingMissingPropertiesMainFragment). This only looks at regular properties, and does not take owned navigations/complex properties into account. When these are mapped to column(s) on the main table, the check should not throw.
Minimal repro
awaitusingvarcontext=newBlogContext();awaitcontext.Database.EnsureDeletedAsync();awaitcontext.Database.EnsureCreatedAsync();publicclassBlogContext:DbContext{publicDbSet<Blog>Blogs{get;set;}protectedoverridevoidOnConfiguring(DbContextOptionsBuilderoptionsBuilder)=>optionsBuilder.UseSqlServer("Server=localhost;Database=test;User=SA;Password=Abcd5678;Connect Timeout=60;ConnectRetryCount=0;Encrypt=false").LogTo(Console.WriteLine,LogLevel.Information).EnableSensitiveDataLogging();protectedoverridevoidOnModelCreating(ModelBuildermodelBuilder){modelBuilder.Entity<Blog>(b =>{b.OwnsMany(p =>p.Addresses, b =>b.ToJson());b.SplitToTable("Phonenumbers", b =>b.Property(p =>p.Phonenumber));});}}publicclassBlog{publicintId{get;set;}// public string Name { get; set; } // Without this model validation throws although Addresses is mappedpublicstringPhonenumber{get;set;}publicList<Address>Addresses{get;set;}}publicclassAddress{publicstringStreet{get;set;}}
Activity