【发布时间】:2016-12-21 00:17:41
【问题描述】:
从 EF6.1 开始,我们有一种方法可以在属性上指定聚集索引
public class Person
{
[Index(IsClustered = true, IsUnique = true)]
public long UserName { get; set; }
}
但是这个 Index 属性现在似乎不在 EF Core 中?在 EF Core 中如何实现这一点?
【问题讨论】:
-
用于索引的 fluent Api 示例参见 learnentityframeworkcore.com/configuration/fluent-api/…
标签: entity-framework entity-framework-core clustered-index