I’m trying to avoid double up on my validation and want to know if MVC data annotation validation can be trusted as ‘server side validation’.
I’ve read several posts saying I should validate again in the business layer but I’d rather avoid doubling up the same validation.
Should I ignore data annotations all together and have my business layer do all server side validation which I can then pass on the the UI?
It’s client-side validation that can’t be trusted — this means javascript. Your MVC code is fine (if the validation is in C#, it’s most certainly server-side) and the results of your validation can be trusted. Whether you also want to perform validation in your business layer is up to you.