The model backing the 'MainDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).
The model backing the 'MainDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).
解决方法:
如果你用的是 DB FIRST ,删除数据库中 _Migration 开头的表。
起因:
在写DbContext时,在OnModelCreating 内,忘记加:
//移除复数表名,否则会查不到数据
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
导致时数据库内产生了_Migration 开头的表,
当你加上 modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); 这行代码后,运行时,就会提示这个。
The model backing the 'MainDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).的更多相关文章
- EF框架CodeFirst the model backing the 'PModelEntities' context has changed since the database was created. Consider using Code First Migrations to update the database
1.采用code first 做项目时,数据库已经生成,后期修改数据库表结构.再次运行时出现一下问题: Entity Framework : The model backing the 'Produc ...
- Model backing a DB Context has changed; Consider Code First Migrations
Model增加一个字段,数据库对应的也手动添加了字段但是运行时报错 The model backing the 'TopLogDbContext' context has changed since ...
- The model backing the 'XXX' context has changed 错误
https://blog.csdn.net/hit_why/article/details/72778785 https://blog.csdn.net/hit_why/article/details ...
- 支持“***Context”上下文的模型已在数据库创建后发生更改。请考虑使用 Code First 迁移更新数据库(http://go.microsoft.com/fwlink/?LinkId=238269)。
在用VS进行MVC开发的过程中遇到如下问题: 支持“***Context”上下文的模型已在数据库创建后发生更改.请考虑使用 Code First 迁移更新数据库(http://go.microsoft ...
- The model backing has changed
其他信息: The model backing the 'WebTopFormContext' context has changed since the database was created. ...
- Entity Framework : The model backing the '' context has changed since the database was created
1.采用code first 做项目时,数据库已经生成,后期修改数据库表结构.再次运行时出现一下问题: Entity Framework : The model backing the '' cont ...
- The entity type XXX is not part of the model for the current context.
今天遇到了一个奇葩问题,虽然解决了,但还是一脸懵,先附赠一下别人的解决方案:https://www.cnblogs.com/zwjaaron/archive/2012/06/08/2541430.ht ...
- ASP.NET MVC 学习6、学习使用Code First Migrations功能,把Model的更新同步到DB中
参考:http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-th ...
- MVC学习6 学习使用Code First Migrations功能 把Model的更新同步到DB中
参考:http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-th ...
- MVC5中Model层开发数据注解 EF Code First Migrations数据库迁移 C# 常用对象的的修饰符 C# 静态构造函数 MSSQL2005数据库自动备份问题(到同一个局域网上的另一台电脑上) MVC 的HTTP请求
MVC5中Model层开发数据注解 ASP.NET MVC5中Model层开发,使用的数据注解有三个作用: 数据映射(把Model层的类用EntityFramework映射成对应的表) 数据验证( ...
随机推荐
- 暑期集训 Day10 —— 模拟赛复盘
${\color{Green} \mathrm{Problem\ 0 :water }} $ 题如其名,可以用单调队列做,但是数据范围直接暴力枚举每一高度就行. 最不会打错的,还是暴力,所以用暴力. ...
- 如何迁移 Flink 任务到实时计算
简介: 本文由阿里巴巴技术专家景丽宁(砚田)分享,主要介绍如何迁移Flink任务到实时计算 Flink 中来. 通常用户在线下主要使用 Flink run,这会造成一些问题,比如:同一个配置因版本而变 ...
- SAE助力「海底小纵队学英语」全面拥抱Serverless,节省25%以上成本
简介: 阿里云Serveless应用引擎SAE 具备免运维IaaS.按需使用.按量计费.低门槛服务应用上云,并且支持多种语言和高弹性能力等特点,刚好完美解决了客户长期以来运维复杂.资源利用率不高.开发 ...
- 数据的“敏捷制造”,DataWorks一站式数据开发治理范式演进
简介: 企业大数据技术发展至今,历经了两次蜕变.第一次蜕变从最初的"小作坊"解决大数据问题,到后来企业用各类大数据技术搭建起属于自己的"大平台",通过平台化的能 ...
- CMake 教程(待完善)
Cmake 教程 写在前面 如果工程只有几个文件,直接编写Makefile更直接明了 如果使用C.C++.之外的语言,请不要使用cmake 如果使用的语言有非常完备的构建体系,不需要使用cmake C ...
- 一键自动化博客发布工具,chrome和firfox详细配置
blog-auto-publishing-tools博客自动发布工具现在已经可以同时支持chrome和firefox了. 很多小伙伴可能对于如何进行配置和启动不是很了解,今天带给大家一个详细的保姆教程 ...
- 前端使用 Konva 实现可视化设计器(9)- 另存为SVG
请大家动动小手,给我一个免费的 Star 吧~ 大家如果发现了 Bug,欢迎来提 Issue 哟~ github源码 gitee源码 示例地址 另存为SVG 这一章增强了另存为的能力,实现" ...
- ruby 定时器 rufus-scheduler
安装 gem install rufus-scheduler ruby #!/usr/bin/env ruby require 'rubygems' require 'rufus-scheduler' ...
- WEB服务与NGINX(15)-NGINX安装第三方模块
1.nginx安装第三方模块 nginx安装第三方模块需要进行编译安装,安装方法如下: ./configure --prefix=/你的安装目录 --add-module=/第三方模块目录 ... 注 ...
- 5GC 关键技术之 CUPS(控制与用户面分离)
目录 文章目录 目录 前文列表 CUPS(控制与用户面分离) 前文列表 <简述移动通信网络的演进之路> <5G 第五代移动通信网络> <5GC 关键技术之 SBA(基于服 ...