© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
33 replies
Ruttie

duplicate key error efcore

I'm trying to use efcore but I'm getting a
duplicate key value violates unique constraint "PK_Tags"
duplicate key value violates unique constraint "PK_Tags"
error.
My model contains:
        [Required]
        public List<string> Tags { get; set; } = [];
        [Required]
        public List<string> Tags { get; set; } = [];
however, this is not a key?
I'm updating the value by getting it from the database, modifying it, then calling Update with the modified value.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ EFCore: Duplicate key violates unique constraint
C#CC# / help
3y ago
Error EfCore
C#CC# / help
4y ago