Check out example codes for "how to add index to database code first .net core". It will help you in understanding the concepts better.

Code Example 1

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.Entity<Blog>()
        .HasIndex(b => b.Url)
        .HasName("Index_Url");
}

Code Example 2

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.Entity<Blog>()
        .HasIndex(b => b.Url)
        .IsUnique();
}

Learn ReactJs, React Native from akashmittal.com