-1
Good morning, everyone ! I am studying about mapping (model and viewmodel), using implicit Operators. But a question arose: How to organize the viewmodels and mappings within the project ? Where should I save the classes ? Inside the model class file or create your own or even a folder only for viewmodels ? And about mapping, which "location" should I write the code ?
Thanks in advance for the help !
Hello @Renato, this question is a little wide. It would be better to separate into smaller questions and exemplify what you want, so it will be easier to help you.
– Randrade
Example: I have the User model and the viewmodel Login. As I will map "in hand" (implicit Operators), the doubt is organizational. First question: create the viewmodel class Login in the User model file ? Second question: The mapping, where should I create it ? In the User model file ? Forgive me for not being more explicit.
– Renato
So Renato, this question is wide. Do you want to know how to do it? Where to do it? Name of the directories where to put the classes? All these are different questions, which leaves your question wide open
– Randrade
As I said, it is an organizational question of how the project structure should look. I create a folder only for viewmodels ?
– Renato
A folder is usually created for
ViewModels
, thus leaving a better organization. That is, if you are using a standard MVC structure.– Randrade
Yes, it’s MVC. I appreciate the guidance !
– Renato