private static void InitializeMembershipProvider(string connectionStringName, string connectionString, string providerName, string userTableName, string userIdColumn, string userNameColumn, bool createTables, bool checkIfInitialized = false) { if (checkIfInitialized) { if (_provider != null) { return; } } MySqlSimpleMembershipProvider simpleMembership = new MySqlSimpleMembershipProvider(Membership.Provider); if (_provider != null && _provider.Initialized) { throw new InvalidOperationException(Resources.SimpleMembershipAlreadyInitialized); } simpleMembership.ConnectionStringName = connectionStringName; simpleMembership.ConnectionString = connectionString; simpleMembership.ProviderName = providerName; simpleMembership.UserTableName = userTableName; simpleMembership.UserIdColumn = userIdColumn; simpleMembership.UserNameColumn = userNameColumn; if (createTables) { simpleMembership.CreateTables(); } else { simpleMembership.ValidateUserTable(); } simpleMembership.Initialized = true; _provider = simpleMembership; }