Just in case there is a problem with concepts, I define:
Model: = The class that establishes the Tables of the database.
ViewModel: = The class I use to send to the Views (so as not to pass the complete Model).
My question is this:
To establish the KEY or to indicate that it is a possible unique value in the database, I have to put the corresponding Data Annotations in the Model.
But to establish that a property is mandatory or that it can not be equal to 0 for example, do I put the corresponding Data Annotation in the ViewModel only? Or do I have to put both in the Model and in the ViewModel?
It is assumed that in the View the data is loaded in the ViewModel, therefore it is in the ViewModel where the Data Annotation should be with their respective Error messages.
Am I right?