In the hands of some players who are not very strong in technology, when designing the database, it is inevitable that certain fields will not be considered. Only when the function is implemented later can you notice that there are fewer fields in the database or more unnecessary fields. So we still have to do some tricks in the database.
This article lists in asp mvc. When you use the EF framework to map all the entities, you suddenly find that there are fewer fields in the database. You can add it impatiently. Try to add it with a happy mood. The result What if the field is updated synchronously, but the data is not updated synchronously?
Add a new field in the entity class:
public Nullable<int> mtiaozhanjin { get; set; }
The data in the database:
But the result of executing the application is this:
What should I do? It has been solved for a long time, and there is no online search. Finally, I figured it out by myself. The following is the specific method:
1. Open the relationship diagram:
2. Right-click on the design diagram and click the menu [Update Model from Database]:
Then it is ok.
Welcome to pay attention to the public number ~