Exemple #1
0
        internal static void InitializeMembershipProvider(
            SimpleMembershipProvider simpleMembership,
            DatabaseConnectionInfo connect,
            string userTableName,
            string userIdColumn,
            string userNameColumn,
            bool createTables,
            SimpleMembershipProviderCasingBehavior casingBehavior)
        {
            if (simpleMembership.InitializeCalled)
            {
                throw new InvalidOperationException(WebDataResources.Security_InitializeAlreadyCalled);
            }

            simpleMembership.CasingBehavior = casingBehavior;
            simpleMembership.ConnectionInfo = connect;
            simpleMembership.UserIdColumn   = userIdColumn;
            simpleMembership.UserNameColumn = userNameColumn;
            simpleMembership.UserTableName  = userTableName;
            if (createTables)
            {
                simpleMembership.CreateTablesIfNeeded();
            }
            else
            {
                // We want to validate the user table if we aren't creating them
                simpleMembership.ValidateUserTable();
            }
            simpleMembership.InitializeCalled = true;
        }
 internal static void InitializeMembershipProvider(SimpleMembershipProvider simpleMembership, DatabaseConnectionInfo connect, string userTableName, string userIdColumn, string userNameColumn, bool createTables)
 {
     if (simpleMembership.InitializeCalled) {
         throw new InvalidOperationException(WebDataResources.Security_InitializeAlreadyCalled);
     }
     simpleMembership.ConnectionInfo = connect;
     simpleMembership.UserIdColumn = userIdColumn;
     simpleMembership.UserNameColumn = userNameColumn;
     simpleMembership.UserTableName = userTableName;
     if (createTables) {
         simpleMembership.CreateTablesIfNeeded();
     } else {
         // We want to validate the user table if we aren't creating them
         simpleMembership.ValidateUserTable();
     }
     simpleMembership.InitializeCalled = true;
 }