nie mogę znaleźć sposób, aby dodać unikalny ograniczenie do mojego atrybutu polaEntity Framework rdzenia dodać UNIQUE Kod pierwszego
public class User
{
[Required]
public int Id { get; set; }
[Required]
// [Index("IX_FirstAndSecond", 2, IsUnique = true)] not supported by core
public string Email { get; set; }
[Required]
public string Password { get; set; }
}
Używam
"Microsoft.EntityFrameworkCore": "1.0.1",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.1",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
Próbki biegle API dla indeksów zobaczyć na https://www.learnentityframeworkcore.com/configuration/fluent-api/hasindex-metho d –