Using ProviderBase for Membership Provider
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
.
精彩评论