1.无法对 null 引用执行运行时绑定
页面上的 @ViewBag.XXX 在Controller中没有赋值,值为null,对其做了其他操作,如ToString().
2.配置系统未能初始化 / 无法识别的元素。
WebConfig 或者 AppConfig 配置错误
3.The entity types 'XXModel' and 'XXXModel' cannot share table 'XX' because they are not in the same type hierarchy or do not have a valid one to one foreign key relationship with matching primary keys between them.
因为它们不在相同的类型层次结构中,或者它们之间没有与匹配的主键有效的一对一的外键关系。
复制粘贴的时候的锅:codefirst标记表名特性的时候重复了[Table("XXX")]
4.运算符“==”无法应用于“System.Collections.Generic.Dictionary”和“int”类型的操作数
ViewData["NAME"] 与 ViewBag.NAME不能同时存在。数据类型导致错误,后面的会把前面的给覆盖了。