Page 1 of 1

Composite UNIQUE INDEX on multiple columns EF Core

Posted: Wed 31 Jul 2019 14:34
by PixelHunter
Hi!

I would like to have a composite unique key with three properties/columns, something like this: https://stackoverflow.com/questions/228 ... s-in-table.

How can I achieve this?

Is there a way to edit the script generated by the model, so that I can reflect this change in Sql Server?

Thanks in advance!

Re: Composite UNIQUE INDEX on multiple columns EF Core

Posted: Thu 01 Aug 2019 14:38
by Shalex
For each property, that participates in a composite unique index, open Property Editor, press [...] against Column to show Column Editor and set Unique Key (the same name for all properties within one composite unique key).