使用.NET成员资格提供结合实体框架4.3迁移 [英] Using .Net Membership Provider in conjunction with Entity Framework 4.3 migrations

查看:130
本文介绍了使用.NET成员资格提供结合实体框架4.3迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个应用程序,到目前为止,我们已经通过管理实体框架4.3 code数据库和域先用迁移...

I'm working on an application where so far we have been managing the database and domain via Entity Framework 4.3 code first with migrations...

由于这里看到的... <一href="http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-$c$c-based-migrations-walkthrough.aspx" rel="nofollow">http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-$c$c-based-migrations-walkthrough.aspx

As seen here... http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-code-based-migrations-walkthrough.aspx

我们已经开始需要实现会员的点,是想利用.NET成员提供。在过去,我刚才用aspnet_regsql.exe的生成数据库中所有的成员表。有没有办法让它所以这些成员表,在数据库中保存生成的迁移的一个组成部分?

We have come to the point of needing to implement membership and are wanting to use .NET Membership provider. In the past I have just used aspnet_regsql.exe to generate all the membership tables in the database. Is there a way to make it so these membership tables get generated in the database as part of one of the migrations?

推荐答案

也许你可以使用类SqlServices安装服务:

Maybe you can use the class SqlServices to install the services:

http://msdn.microsoft.com/en-us/library/system.web.management.sqlservices.install.aspx

例如:

SqlServices.Install ("databaseName", SqlFeatures.Membership, yourConnectionString); 
SqlServices.Install ("databaseName", SqlFeatures.RoleManager, yourConnectionString);

我希望我是有帮助的。

I hope I was helpful.

这篇关于使用.NET成员资格提供结合实体框架4.3迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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