I\'m trying to make a custom validation [IsUnique]. That check if is property value is unique and return a proper message.
This is my code, but this only work for a spec
I think the best way is to let the database do its works.
Create a constraint in the database to prevent two articles have the same name (or whatever uniqueness you need). Then, when the user create a new article or update an existing one with an existing article name, the database will throw an exception. Catch that exception and let the user knows about the issue.