Guys,
How to solve the index name conflict in EF
A
B - Has index named abc
C
D - Has index named abc
E - change named abc - abc1
Guys,
How to solve the index name conflict in EF
A
B - Has index named abc
C
D - Has index named abc
E - change named abc - abc1
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Muhammad Imran AnsariPosted Jan 29, 2023, 5:31 PM
Hi,
To resolve index name conflict is by using attribute [Index(IsUnique = true, Name = "Index_Name")] on the property of the entity class.
This way, you are specifying the Index name on the property level, which would resolve the conflict.
Reference Link:
https://learn.microsoft.com/en-us/ef/core/modeling/indexes?tabs=data-annotations