大多数人都使用 .NET 的 SqlMembershipProvider、SqlRoleProvider 和 SqlProfileProvider 吗?

发布于 2024-07-26 00:22:16 字数 556 浏览 2 评论 0原文

大多数人在开发具有成员资格功能的站点时是否使用.NET 的 SqlMembershipProvider、SqlRoleProvider 和 SqlProfileProvider?

还是很多人都创建了自己的提供商,甚至完全是自己的会员系统?

SQL 提供程序有哪些限制会让您自行推出?

扩展 SQL 提供程序以提供附加功能是否容易?

供参考
Per Scott Gu 的博客Microsoft 提供了 SqlMembershipProvider 的源代码您可以自定义它,而不是从头开始。 仅供参考。

Do most people use .NET's SqlMembershipProvider, SqlRoleProvider, and SqlProfileProvider when developing a site with membership capabilities?

Or do many people make their own providers, or even their own membership systems entirely?

What are the limitations of the SQL providers that would make you roll your own?

Is it easy to extend the SQL providers to provide additional functionality?

For Reference
Per Scott Gu's Blog, Microsoft provides the source code for the SqlMembershipProvider so that you can customize it, instead of starting from scratch. Just an FYI.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

甜心 2024-08-02 00:22:16

我们使用除配置文件提供程序之外的所有内容。 配置文件提供程序完全基于文本并进行全文搜索 - 随着用户群变大,这会变得非常慢。 我们发现这是一个更好的解决方案,可以“扮演我们自己的角色”会员 API 数据库的配置文件部分,该数据库以会员中的用户 ID 为键。

We use everything except the Profile Provider. The Profile Provider is completly text based and does full text seearches - this becomes exceedingly slow as you user base gets larger. We have found it a much better solution to "role our own" profile section of the membership api database that is keyed to the userid in membership.

心在旅行 2024-08-02 00:22:16

我已经使用派生的 MembershipUser 类型推出了自己的 MembershipProvider 类来包装自定义用户架构,因此配置文件样式属性现在可以作为派生用户的一部分通过投掷。

I've rolled my own MembershipProvider classes using derived MembershipUser types to wrap the custom user schema, so profile-style properties are now available everywhere as part of the derived user via a cast.

三生一梦 2024-08-02 00:22:16

我通常使用开箱即用的提供程序,我遇到的主要问题是跨用户的个人资料属性查询。 例如,查找具有名为 Car 的配置文件属性等于 true 的所有用户。 这取决于它们在底层结构中的存储方式。

I normally use the providers that come out of the box, the main problem I have is querying across profile attributes across users. For example finding all users that have a profile attribute called Car that equals true. This is down to the way they are stored in the underlying structure.

唯憾梦倾城 2024-08-02 00:22:16

我以前使用过 SqlMembership,它非常好,除非您需要自定义的东西。 我记得需要诸如名字和姓氏信息之类的信息,但我意识到没有相应的字段。 最后,我没有扩展,而是使用了提供者的 Comment 字段,并向其中添加了名称信息。 这可能是一种不好的做法/懒惰/黑客方式,但它在紧张的情况下对我有用。

I've used SqlMembership before and it's quite nice, unless you need something custom. I remember needing something like firstname and lastname info and I realised there're no fields for that. In the end instead of extending I've used Comment field of the provider and added name info to there. This is probably a bad practice/lazy/hack way but it worked for me in a tight situation..

晨光如昨 2024-08-02 00:22:16

从理论上讲,它们听起来不错,但如果您在不创建大量抽象包装器的情况下进行任何单元测试,那么它们就没有机会。

In theory they sound nice, but not a chance if you do any unit testing without creating lots of abstract wrappers.

南巷近海 2024-08-02 00:22:16

如果您只需要基本的用户支持(角色、配置文件等),那么默认提供程序将非常有用。

如果您需要更多自定义支持(默认提供程序 [如 Oracle] 不支持的数据库中的数据存储、现有数据库上的提供程序、高度自定义的模式),那么您应该推出自己的提供程序。

对于我来说,我当前的网站只需要基本的角色支持(和最少的配置文件支持),所以我使用了默认的提供程序。

If you only need the basic user support (roles, profiles, etc.) then the default providers will work great.

If you need more customized support (data storage in a database not supported by the default providers [like Oracle], provider on a database that already exists, a heavily customized schema) then you should roll your own providers.

As for me, my current site only needed basic Roles support (and minimal Profiles support), so I went with the default providers.

寂寞陪衬 2024-08-02 00:22:16

我使用了自定义类和内置类。当您需要访问不同的数据库或架构或需要额外信息时。

我抽象了这些层,以便它可以在逻辑层上工作,并有一个使用 data.common.dbprovider 位的 DAL 层,因此它相当通用。

I have used both the custom classes and built in. When you need to get to a different database or schema or need to have extra info.

I abstracted out the layers so that it would work on the logic layer and have a DAL layer that used the data.common.dbprovider bit so it was reasonably generic.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文