Index Attribute
Index Attribute
public class Book
{
public int Id { get; set; }
[Index]
public string Title { get; set; }
public string Category { get; set; }
public int AuthorId { get; set; }
public Author Author { get; set; }
}protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Book>()
.HasIndex(b => b.Title);
}Last updated
