예제 #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (PermissionIds != null)
         {
             hashCode = hashCode * 59 + PermissionIds.GetHashCode();
         }
         if (ApplicationDataPolicyIds != null)
         {
             hashCode = hashCode * 59 + ApplicationDataPolicyIds.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #2
0
        /// <summary>
        /// Returns true if SubRealmSubmit instances are equal
        /// </summary>
        /// <param name="other">Instance of SubRealmSubmit to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SubRealmSubmit other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     PermissionIds == other.PermissionIds ||
                     PermissionIds != null &&
                     other.PermissionIds != null &&
                     PermissionIds.SequenceEqual(other.PermissionIds)
                 ) &&
                 (
                     ApplicationDataPolicyIds == other.ApplicationDataPolicyIds ||
                     ApplicationDataPolicyIds != null &&
                     other.ApplicationDataPolicyIds != null &&
                     ApplicationDataPolicyIds.SequenceEqual(other.ApplicationDataPolicyIds)
                 ));
        }
예제 #3
0
 public PermissionFilter(IEnumerable <int> ids)
 {
     PermissionIds.AddRange(ids);
 }
예제 #4
0
 public PermissionFilter(int id)
 {
     PermissionIds.Add(id);
 }