コード例 #1
0
        /// <summary>
        ///     Creates a new <see cref="UserPermissionRecord" /> object instance that is a shallow-copy of the current object instance.
        /// </summary>
        /// <returns>
        ///     The shallow-copy of the current <see cref="UserPermissionRecord" /> object instance.
        /// </returns>
        public UserPermissionRecord Clone()
        {
            UserPermissionRecord record = new UserPermissionRecord();

            record.Id          = this.Id;
            record.PrincipalId = this.PrincipalId;
            record.DataType    = this.DataType;
            record.Action      = this.Action;
            record.Allow       = this.Allow;
            return(record);
        }
コード例 #2
0
        /// <summary>
        ///     Indicates whether the current <see cref="UserPermissionRecord" /> instance is equal to another <see cref="UserPermissionRecord" /> instance.
        /// </summary>
        /// <param name="that">
        ///     The <see cref="UserPermissionRecord" /> instance to be compared against this instance.
        /// </param>
        /// <returns>
        ///     True if both instances are considered equal; otherwise, false.
        /// </returns>
        public Boolean Equals(UserPermissionRecord that)
        {
            Boolean result = true;

            result = result && (this.Id == that.Id);
            result = result && (this.PrincipalId == that.PrincipalId);
            result = result && (this.DataType.TrimOrNullify() == that.DataType.TrimOrNullify());
            result = result && (this.Action == that.Action);
            result = result && (this.Allow == that.Allow);
            return(result);
        }