In order to make my web-application project I used some tutorials and downloaded 2 sample projects. I noticed that in both of them entities were imported from the SQL server into the project AND models were created for each related class. From what I understand, the entities represent the database itself while the models are the ones to check validations (for example) and after validations successfully passed, the data is sent in to the entities which in turn get it into the database (?) .
In my project I have no models at all. I thought that the entities represent the models, therefore why shall I create duplicate classes (rather entities and models which both look alike). All the data annotations are inside the entities classes. I was told that each change done in the tables inside the SQL server would erase my entire work.
I would like to know whether it's true or not, as well as why do I acctually need models when I have entities instead. If models ARE needed, how do you acctually pass their data into the entities?
Edit: I found this post Difference between model and entity which answers most of my question. I would like to know whether my entire entity class's annotations are erased whenever I change a simple thing in the SQL server. Why wouldn't the model class be an exact duplicate of the entity class (besides the data annotations)?