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.
HasIndex
params string[] propertyNames
First make sure the shadow property is defined:
modelBuilder.Entity() .Property("AlbumId");
and then define the index:
modelBuilder.Entity() .HasIndex("TrackNumber", "AlbumId") .IsUnique();