Base solution for your next web application
Open Closed

Adding non-unique, non-clustered index to entity attribute #9410


User avatar
0
andry3ag created

We have recently downloaded the ASP.Net Core 3x with Anguylar 9.x (version 8.6). I have tried to add the [index] entity attrivute annotations but its asking me to install entity framework package. I dont wnna install anything, inase it breaks my project. I followed the following documentation on adding index for entity framework code first : https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/data-annotations

Please let me know what I need to do, in order to add "non-unique, non-clustered" index to my entity attribute under my .core project.

Thanks


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    I dont wnna install anything, inase it breaks my project.

    Yes you are right!

    You can config entity index or something in the EntityframeWork layer useing** fluent api**.

    https://docs.microsoft.com/en-us/ef/core/modeling/ https://docs.microsoft.com/en-us/ef/core/modeling/indexes https://github.com/aspnetboilerplate/aspnetboilerplate/blob/e0ded5d8702f389aa1f5947d3446f16aec845287/src/Abp.ZeroCore.EntityFrameworkCore/Zero/EntityFrameworkCore/AbpZeroHostDbContext.cs#L97