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

在dbcontext中进行相关的设置,  

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

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

posted @ 2015-01-08 11:03  地下的知了  Views(197)  Comments(0Edit  收藏  举报