Skip to content

Regression related to nested primitive collections in 10.0.0-rc.2 #3652

@zotanmew

Description

@zotanmew

Heya, I've been testing our application with .NET/EFCore 10 RC2 and the corresponding Npgsql version, and noticed the following bug during startup for nested primitive collections that seems to have been introduced in the most recent version:

Unhandled exception. System.InvalidOperationException: The property 'List<List<string>> Model.Property' is a primitive collection of a primitive collection. Nested primitive collections are not yet supported with relational database providers.

I presume #3623 broke something here.

Minimal repro (works on 9.0.4 and 10.0.0-rc.1, but not on 10.0.0-rc.2):

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;

await using var context = new BlogContext();
await context.Database.EnsureDeletedAsync();
await context.Database.EnsureCreatedAsync();

public class BlogContext : DbContext
{
	public DbSet<Foo> Foos { get; set; }

	protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
		=> optionsBuilder
		   .UseNpgsql("Host=localhost;Username=test;Password=test")
		   .LogTo(Console.WriteLine, LogLevel.Information)
		   .EnableSensitiveDataLogging();

	protected override void OnModelCreating(ModelBuilder modelBuilder)
	{
		modelBuilder.Entity<Foo>(b => b.Property(t => t.Values).HasColumnType("jsonb"));
	}
}

public class Foo
{
	public int Id { get; set; }
	
	public string[][] Values { get; set; }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions