我需要定制会员提供商吗?
我正在构建一个新的 Asp.Net MVC3 解决方案,并希望将所有表放在同一个数据库中(包括成员资格、用户和角色表)。所以我不想有一个单独的 aspnetdb.mdf 文件。我想我只需要调整 Web.config(连接字符串)中的成员资格部分即可指向我唯一的数据库。正确的?如果我错了,请纠正我。所以到目前为止,不需要自定义会员提供程序。
第二个问题:我可以按照自己想要的方式命名用于管理用户(会员资格)的表,而无需自定义会员资格提供程序,还是必须对其进行自定义?我想如果我更改用户表名称,我必须自定义会员资格提供程序。正确的?
谢谢。
I'm building a new Asp.Net MVC3 solution and would like to have all the tables in the same database (including membership, users and roles tables). So I don't want to have a separate aspnetdb.mdf file. I think I only have to adjust membership section in Web.config (connectionstring) in order to point to my unique database. Right? Please correct me if I'm wrong. So until now, no need to customize the membership provider.
Second question: can I name my table for managing users (membership) the way I want without customizing the membership provider or do I have to customize it? I think I have to customize the membership provider if I change the user table name. Correct?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您当然不必实现自己的提供程序(我的意思是,如果您愿意,您可以,但我看不出原因)。
我将创建一个空白数据库,然后通过
aspnet_regsql.exe
工具用成员资格数据库架构填充它。这是一篇很棒的博客文章:在 SQL Server Express 2008 中安装 ASP.NET 会员服务数据库
然后,在其上构建您自己的表、UDF、SP 数据库。最后您将得到一个数据库。
将您的会员提供商指向该数据库,然后您就可以开始了。
You certainly doesn't have to implement your own provider (I mean you can if you want but I cannot see a reason).
I would create a blank database and then fill it in with the Membership database schema via
aspnet_regsql.exe
tool. Here is a great blog post on that:Installing ASP.NET Membership services database in SQL Server Express 2008
Then, build your own tables, UDF, SP on that same database. You will end up with one databse at the end.
Point your membership provider to that database and you are good to go.
描述
看来您必须实现自己的 MembershipProvider 和 MembershipUser。这听起来比做起来难。您可以实现自己的逻辑、自己的数据访问等等。这也是学习 ASP.NET 如何处理授权的一件好事。
更多信息
Description
It looks like you have to implement your own MembershipProvider and MembershipUser. That sounds harder than it is. You can implement your own logic, own data access and more. This i also i good thing to learn how
ASP.NET
handles authorization.More Information