[英]Generated ToList won't work
I'm very new to C# and I'm trying to make a basic little project. 我是C#的新手,正在尝试做一个基本的小项目。 When I try to go to the generated index page (On the view -> Add -> View and then I just gave it the name Index and template List)
当我尝试转到生成的索引页面时(在视图上->添加->视图,然后我给它命名为索引和模板列表)
When I try to use this link to the index page; 当我尝试使用此链接指向索引页面时;
<ul><li>@Html.ActionLink("Beheer", "Index", "Competenties")</li></ul>
I keep getting this error. 我不断收到此错误。
An exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll but was not handled in user code
EntityFramework.dll中发生类型'System.InvalidOperationException'的异常,但未在用户代码中处理
Additional information: The model backing the 'DatabankCompetenties' context has changed since the database was created.
附加信息:自创建数据库以来,支持“ DatabankCompetenties”上下文的模型已更改。 Consider using Code First Migrations to update the database ( http://go.microsoft.com/fwlink/?LinkId=238269 ).
考虑使用Code First Migrations更新数据库( http://go.microsoft.com/fwlink/?LinkId=238269 )。
I tried resetting the Database, rerolling all the tables and using the command update-database, but nothing seems to work. 我尝试重置数据库,重新滚动所有表并使用命令update-database,但似乎没有任何效果。
You modify your Database schema, but you don't migrate the changes. 您修改数据库模式,但不迁移所做的更改。 https://msdn.microsoft.com/en-us/data/jj591621.aspx
https://msdn.microsoft.com/zh-CN/data/jj591621.aspx
Since you are very new to C# I'll give you a very basic solution, which helped me out quite a few times. 由于您是C#的新手,因此我将为您提供一个非常基本的解决方案,该解决方案帮助了我很多次。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.