/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks hash = hash * 59 + Id.GetHashCode(); if (Name != null) { hash = hash * 59 + Name.GetHashCode(); } if (Description != null) { hash = hash * 59 + Description.GetHashCode(); } if (RolePermissions != null) { hash = hash * 59 + RolePermissions.GetHashCode(); } if (UserRoles != null) { hash = hash * 59 + UserRoles.GetHashCode(); } return(hash); } }