I have got.Net Standart 2.0 dll to keep separated entities of MS SQL Server.
The Index Attribute
cannot be resolving.
I've did search and experimented with adding some namespaces of Entity Framework but nothing works even by MSDN .
Please, help. Thank you!
Specifies an index to be generated in the database.
Entity Framework Core
- 5.0
You are not using EF core 5. You will need to use the model Builder instead
Read more here
Configuring indexes via Data Annotations has been introduced in EF Core 5.0.
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Blog>()
.HasIndex(b => b.Url);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.