如何使用EF code首先会员供应商? [英] How to use Membership provider with EF Code First?

查看:142
本文介绍了如何使用EF code首先会员供应商?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于EF code首款车型,我想用默认的MembershipProvider使用它们,但我不知道如何正确地写模式,所以它不会抹掉重新创建我的所有数据表时有对模型所做的更改。

I have models based on EF Code First and I want to use them with the default MembershipProvider, but I don't know how to write the model correctly, so it won't erase all my data on recreating the tables when there were changes made to the model.

推荐答案

目前(EF 4.1 CTP)EF code首先没有这样的选择。它总是滴,如果你更改了模型的表。

Currently (EF 4.1 CTP) EF Code First doesn't have that option. It always drops a table if you made changes to model.

更新:

EF 4.1 RTM允许您创建一个自定义数据库初始化,并指定数据库对象和数据播种的创建。

EF 4.1 RTM allows you to create a custom database initializer and specify creation of db objects and data seeding.

这篇关于如何使用EF code首先会员供应商?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆