ef-code-first – EF 4.1代码第一和现有数据库和.NET成员资格

我的开发框上有一个名为ApplicationName_Development的数据库,运行在sql Server 2008 R2 Developer Edition上.

我将.NET成员资格表添加数据库没有问题.当我尝试获取Code First工作时,我收到以下错误消息:

The server encountered an error
processing the request. The exception
message is “Model compatibility cannot
be checked because the database does
not contain model Metadata. Ensure
that IncludeMetadataConvention has
been added to the DbModelBuilder
conventions.

经过一些搜索,我发现我不得不删除数据库,让EF创建数据库.没关系,但是我丢失了所有的.NET会员表.我可以返回并再次添加会员表,但是如果我的模型发生变化,并且EF需要重新创建数据库,那么我必须再次添加会员表.

如何解决这个问题?

解决方法

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...