efcore.pg icon indicating copy to clipboard operation
efcore.pg copied to clipboard

Support `INCLUDE` for primary keys

Open springy76 opened this issue 4 months ago • 1 comments

Just the same as #697 implemented years ago, but for KeyBuilder instead of IndexBuilder (see https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-PARMS-PRIMARY-KEY )

Usage would be:

entityTypeBuilder.HasKey(e => new { e.A, e.B }).IncludeProperties(e => new { e.C });

pretty just the same as existing:

entityTypeBuilder.HasIndex(e => new { e.A, e.B }).IsUnique().IncludeProperties(e => new { e.C });

springy76 avatar Oct 10 '24 14:10 springy76