C#C
C#3y ago
Kroks

❔ EFCore: Unique Category Name

I have an issue with the entity "Category" that I have.
Each "Target" Entity can have several categories, each category has a name and an Id.
Target Entity has a List of Categories, however now when trying to add categories to an Entity there are duplicates.
If I have two entities and add a category with the same name to both, there will be a dupe category (as the name exists two times and the name of Category entity should be unique)
Was this page helpful?