4
I’m creating a table of Logradouro
where the countryside CEP
is not the primary key, but should be unique.
How do I do it using code-first in the Entity 6.0?
To create primary key I use the method HasKey
:
ToTable("Logradouros").HasKey(x => x.LogradouroId);
I saw that in this method it is possible to use more than one field creating composite key. If the CEP
must be unique and indexed it must be table key too?
According to the links the first solution only works from the
Entity 6.1
and the second relates toEntity 6.2
, I need one that works onEntity 6.0
(I edited my question to specify this)...– Daniel Dutra
but what problem 6.1 and 6.0 have very similar Ipps you can do the simple update by nuget
– pho3nix
I updated Entities and the first solution worked well, thank you!
– Daniel Dutra