I\'m trying to create a multi-column unique index using a shadow property. I know I can solve this problem with just adding a property, but I would like to see if this is po
It's possible. You can simply use the HasIndex overload with params string[] propertyNames.
First make sure the shadow property is defined:
modelBuilder.Entity<AlbumTrack>()
.Property<int>("AlbumId");
and then define the index:
modelBuilder.Entity<AlbumTrack>()
.HasIndex("TrackNumber", "AlbumId")
.IsUnique();