Base solution for your next web application
Open Closed

How to implement the [Index] Data Annotations Here #771


User avatar
0
karaneeswara created

Hi ,

How to implement the [Index] Data Annotations of EF version 6.1 onwards in ABP Framework ?

How can i make one column as Unique ?

Thanks in advance

:roll: :roll: :roll: :roll:


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

    You can add EntityFramework reference (nuget package) to your Core (domain) project and directly use [Index] attributes. This make your domain a bit depended to EF, but not much problem.

    If you don't like it, you can create indexes by overriding OnModelCreating method of your DbContext class. You can search web to learn how to create indexes in OnModelCreating.