Unique Constraints for Entity Framework Core v2

Posts   
 
    
Puromtec
User
Posts: 76
Joined: 22-Jun-2005
# Posted on: 24-Apr-2018 18:50:10   

LLBL Gen version: 5.3.4 Framework: Entity Framework Core v2

I have set a few unique constraints on entities in the designer but I do not see any resulting HasUnique/HasIndex in the generated code. I have to figure out myself how to set these on model first for EF Core v2.

Any plans to support this, or am I missing something?

Thanks!

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 25-Apr-2018 06:03:16   

Unique constraints are not generated as indexes nor as alternative keys. The designer doesn't support alternate keys and unique constraints have no real value to the Entity Framework Core engine. The constraint is already defined in the DB where it is enforced, so it's not really useful to generate the index, as LLBLGen Pro doesn't generate relational model meta data into the mappings.

ref: http://www.llblgen.com/documentation/5.3/Entity%20Framework/VCore2/Limitations.htm