开发者

Using ProviderBase for Membership Provider

开发者 https://www.devze.com 2022-12-30 00:57 出处:网络
Is it possible to simply inherit from ProviderBase to write a MembershipProvider, instead of inhering from System.We开发者_高级运维b.Security.MembershipProvider?

Is it possible to simply inherit from ProviderBase to write a MembershipProvider, instead of inhering from System.We开发者_高级运维b.Security.MembershipProvider?

There's just so much junk in the default one, we really want something much, much simpler.


No.

There is no IMembershipProvider interface.

The membership infrastructure requires a class derived from the abstract MembershipProvider class.

Otherwise, how would asp.net know which method to call to, for instance, GetUser?

What you are calling 'junk' are simply abstract methods that define the API.

If you do not want/need to implement a feature, just fill the stub with a NotImplementedException.

0

精彩评论

暂无评论...
验证码 换一张
取 消