简体   繁体   English

在ASP.NET MVC 5中,在对MODEL类进行更改以应用迁移后,它也会更改View .cshtml文件吗?

[英]In ASP.NET MVC 5, after i apply migrations for a change in MODEL class ,will it change my View .cshtml file as well?

I applied some changes in my student.cs (model) file and updated the database through migrations. 我在student.cs(模型)文件中应用了一些更改,并通过迁移更新了数据库。 But i need to see those changes in my view as well. 但是我也需要看到这些变化。 Is it going to appear itself or do i need to a manually add those newly added values? 它会自行出现还是我需要手动添加这些新添加的值?

Migrations is not going to generate any code for you. 迁移不会为您生成任何代码。 If you're model changed, then Visual Studio's "Auto Rename" feature can update existing properties (provided you chose to do so). 如果您更改了模型,则Visual Studio的“自动重命名”功能可以更新现有属性(前提是您选择这样做)。 But other than, its not going to scaffold newer properties in the View automatically. 但是除此之外,它不会自动在视图中设置较新的属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM