I have a project in Asp net mvc. An entity called product can not have similar titles. As I am following repository pattern where is the best place to check the duplication?
I can do it in controller but it will lead to a fat controller.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If it is a very hard and fast rule, backing it with a database constraint is highly advisable–that will back-stop your code and make sure no slip-ups get through.
Insofar as enforcing the rule in code, how are you currently handling validation? This definitely falls into that category.