MVC4 ExtendedMembershipProvider和的EntityFramework [英] MVC4 ExtendedMembershipProvider and entityframework

查看:134
本文介绍了MVC4 ExtendedMembershipProvider和的EntityFramework的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够使用相同的数据库应用程序的ASP成员详细信息窗体身份验证。我目前使用MVC4。当我开始并添加了system.web.providers到我的项目我有一个单独的默认连接。我已经修改了字符串以指向同一个数据库,在我的应用程序(的EntityFramework)被使用。

i want to be able to use the same database for the application as the asp membership details for forms authentication. I am currently using MVC4. When i started and added the system.web.providers to my project i got a seperate default connection. I have modified the string to point to the same database as that being used in my application (entityframework).

我应该想到提供商自动创建此数据库即表。

Should i expect the providers to autocreate the tables in this database i.e.


  • webpages_Membership

  • 用户配置

  • webpages_Roles

  • webpages_OAuthMembership

目前我正在...

要调用这个方法,Membership.Provider属性必须是
  ExtendedMembershipProvider

To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider"

当我尝试注册通过默认mvc4应用程序模板的新用户。而表是不存在的。

when i try and register a new user via the default mvc4 application template. And the tables are absent.

问候
蒂姆·

推荐答案

这里的问题是,默认mvc4互联网模板使用simplemembership管理会员/角色的信息。在模板中code的的这个假定并只能与simplemembership工作。当您安装通用的供应商账户控制器code鼓起,因为它无法理解通用的供应商。看看这个帖子,进一步解释了这个场景
<一href=\"http://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates.aspx\">http://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates.aspx

the issue here is that the default mvc4 internet template is using simplemembership to manage membership/roles information. the code in the template has assumption of this and can only work with simplemembership. when you install universal providers the account controller code blows up since it cannot understand universal providers. look at this post which explains further on this scenario http://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates.aspx

这篇关于MVC4 ExtendedMembershipProvider和的EntityFramework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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