efcore.pg
efcore.pg copied to clipboard
Support `INCLUDE` for primary keys
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 });