As our application is an existing one and with lots of data we decided to implement our own MembershipProvider.
In this process I had to customize CreateUser with different signature. And this is my signature.
public MembershipUser CreateUser(string firstName, string lastName, string password, string email, string phone, out MembershipCreateStatus status, string title = null, UserRole role = UserRole.User)
{
// New user logic
}
I am calling this CeateUser method after initializing my provider. As I am initializing the instance, but I am not calling the Initialize method on that instance. How to avoid this initialization part and calling my CreateUser method.
var provider = new EastpointMembershipProvider();
provider.CreateUser(model.UserName,string.Empty, model.Password, model.Email, string.Empty,out createStatus,"Mr");
Thanks
After browsing for a while I found no need to Initialize the custom membership provider explicitly.
Initialize will be called when we retrieve provider from Membership.Provders[“ProviderName”].