I'm trying to implement a customer ASP.NET Membership provider. I have no database yet, but I know I want one that's simple and accessible.
I know I don't want to use the generated tables because from what I've seen and understand, they are very convoluted and include many fields that I just won't need. I set up the default Membership provider and let it generate its own database/tables and it produced this:
All by itself. I don't want this mess as part of my database. So the natural solution? A custom membership provider. To do this, I know you need to inherit from System.Web.Security.MembershipProvider and setup web.config to the derived class that I create.
public class MessAround : System.Web.Security.MembershipProvider
{
public MessAround()
{
//
// TODO: Add constructor logic here
//
}
public override string ApplicationName
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public override bool ChangePassword(string username, string oldPassword,
string newPassword)
{
throw new NotImplementedException();
}
public override bool ChangePasswordQuestionAndAnswer(string username
, string password, string newPasswordQuestion, string newPasswordAnswer)
{
throw new NotImplementedException();
}
....ETC ETC ETC
My question is:
How do I integrate this class into a custom database schema?
How do I eliminate fields that I don't need?
How do I get this class to interact with my database tables?
WTF is going on? :P
throw new NotImplementedException();
from the methods you will use and instead add you own implementaion in them. Those methods you will not need you can leave as is with the throw. Check this answer to get started: stackoverflow.com/a/5702000/1429080 – user1429080