コード例 #1
0
ファイル: RoleTable.cs プロジェクト: thongnvbka/LacHongVien_B
        /// <summary>
        /// Deltes a role from the Roles table
        /// </summary>
        /// <param name="roleId">The role Id</param>
        /// <returns></returns>
        public int Delete(string roleId)
        {
            const string commandText = @"DELETE FROM ANID2ROLES WHERE ID = :ID";
            var          parameters  = new List <OracleParameter>
            {
                new OracleParameter {
                    ParameterName = "ID", Value = roleId, OracleDbType = OracleDbType.Varchar2
                },
            };

            return(_database.Execute(commandText, parameters));
        }
コード例 #2
0
        /// <summary>
        /// Deletes all claims from a user given a userId
        /// </summary>
        /// <param name="userId">The user's id</param>
        /// <returns></returns>
        public int Delete(string userId)
        {
            const string commandText = @"DELETE FROM ANID2USERCLAIMS WHERE USERID = :USERID";
            var          parameters  = new List <OracleParameter>
            {
                new OracleParameter {
                    ParameterName = "USERID", Value = userId, OracleDbType = OracleDbType.Varchar2
                },
            };

            return(_database.Execute(commandText, parameters));
        }
コード例 #3
0
        /// <summary>
        /// Sets the user's password hash
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="passwordHash"></param>
        /// <returns></returns>
        public int SetPasswordHash(string userId, string passwordHash)
        {
            const string commandText = @"UPDATE ANID2USERS SET PASSWORDHASH = :PWHASH WHERE ID = :USERID";
            var          parameters  = new List <OracleParameter>
            {
                new OracleParameter {
                    ParameterName = "PWHASH", Value = passwordHash, OracleDbType = OracleDbType.Clob
                },
                new OracleParameter {
                    ParameterName = "USERID", Value = userId, OracleDbType = OracleDbType.Varchar2
                }
            };

            return(_database.Execute(commandText, parameters));
        }
コード例 #4
0
        /// <summary>
        /// Deletes a login from a user in the UserLogins table
        /// </summary>
        /// <param name="user">User to have login deleted</param>
        /// <param name="login">Login to be deleted from user</param>
        /// <returns></returns>
        public int Delete(IdentityUser user, UserLoginInfo login)
        {
            const string commandText = @"DELETE FROM ANID2USERLOGINS WHERE USERID = :USERID AND LOGINPROVIDER = :LOGINPROVIDER AND PROVIDERKEY = :PROVIDERKEY";
            var          parameters  = new List <OracleParameter>
            {
                new OracleParameter {
                    ParameterName = "USERID", Value = user.Id, OracleDbType = OracleDbType.Varchar2
                },
                new OracleParameter {
                    ParameterName = "LOGINPROVIDER", Value = login.LoginProvider, OracleDbType = OracleDbType.Varchar2
                },
                new OracleParameter {
                    ParameterName = "PROVIDERKEY", Value = login.ProviderKey, OracleDbType = OracleDbType.Varchar2
                },
            };

            return(_database.Execute(commandText, parameters));
        }