Entity Framework Core中的索引可以使用哪些操作?

时间:2017-05-29 21:33:17

标签: c# entity-framework-core

我看到你可以在流畅的API https://docs.microsoft.com/en-us/ef/core/modeling/indexes中指定索引。但是,我没有看到如何在Fluent API查询中使用索引。

假设我已经定义了一个唯一索引:

    protected override void OnModelCreating(ModelBuilder builder)
    {
        builder.Entity<PlayerRank>()
            .HasIndex(p => new { p.Date, p.World, p.Player })
            .HasName("UNIQUE_KEY")
            .IsUnique();
        base.OnModelCreating(builder);
    }

使用流畅的API我能做些什么呢?哪些操作可以利用它?

0 个答案:

没有答案