您的位置:首页 > 博客中心 > 数据库 >

Code First 解除数据库与Entity的绑定关联

时间:2022-03-14 04:45

在dbcontext中进行相关的设置,  

static CommonContext()
{
    Database.SetInitializer<CommonContext>(null);
}

通过该设置,可以减去数据库与实体的对照所造成的版本不对应的问题。

热门排行

今日推荐

热门手游