Open roji opened 2 months ago
Oops, false alarm - forgot to configure the nested types as nested (see repro above)... Leaving open to possibly consider emitting the error about navigations on complex types (which gets thrown if the container does have a simple property):
Unable to configure navigation 'Blog.ComplexContainer#ComplexContainer (ComplexContainer).Containee1' of type 'ComplexContainee1' as complex types don't support navigations. Ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'
Ultimately, IMHO nested complex types shouldn't need to be manually configured, but should instead be detected as complex types by convention, at which point this will error more usefully anyway.
(am OK with closing if you prefer @AndriySvyryd)
This fails model validation:
We should also fix the typo
has no properties defines
->has no properties defined
. Once the model validation is fixed, we should also test that saving and querying works.Repro
```c# await using var context = new BlogContext(); await context.Database.EnsureDeletedAsync(); await context.Database.EnsureCreatedAsync(); var container = new ComplexContainer { Containee1 = new(), Containee2 = new() }; _ = await context.Blogs.Where(b => b.ComplexContainer == container).ToListAsync(); public class BlogContext : DbContext { public DbSet