public bool Equals(InboxRuleRequest other) { var listsAreEqual = false; switch (UserSelection) { case SystemUserSelection.Contacts: listsAreEqual = !ContactList.Except(other.ContactList).Union(other.ContactList.Except(ContactList)).Any(); break; case SystemUserSelection.Groups: listsAreEqual = !GroupList.Except(other.GroupList).Union(other.GroupList.Except(GroupList)).Any(); break; } return(UserSelection == other.UserSelection && RuleTypeUser == other.RuleTypeUser && RuleTypeSubject == other.RuleTypeSubject && Subject == other.Subject && listsAreEqual); }
private List<UserGroup> GetExistingNonDefaultGroups(GroupList userGroups) { return userGroups.Except(GetDefaultGroups(userGroups)) .ToList<UserGroup>(); }
private List<UserGroup> GetAddNewGroups(GroupList userGroups) { return userGroups.Except(GetExistingNonDefaultGroups(userGroups)).Except(GetDefaultGroups(userGroups)) .Where(group => group.PolicyLevel >= GroupPolicyLevel.UsersAdd) .ToList<UserGroup>(); }
private List<UserGroup> GetExistingNonDefaultGroups(GroupList userGroups) { return userGroups.Except(GetDefaultGroups(userGroups)).Where(group => group.PolicyLevel >= GroupPolicyLevel.UsersAdd || group.Owner == Context.User.Identity.Name) .ToList<UserGroup>(); }
private List <UserGroup> GetExistingNonDefaultGroups(GroupList userGroups) { return(userGroups.Except(GetDefaultGroups(userGroups)).Where(group => group.PolicyLevel >= GroupPolicyLevel.UsersAdd || group.Owner == Context.User.Identity.Name) .ToList <UserGroup>()); }
private List <UserGroup> GetAddNewGroups(GroupList userGroups) { return(userGroups.Except(GetExistingNonDefaultGroups(userGroups)).Except(GetDefaultGroups(userGroups)) .Where(group => group.PolicyLevel >= GroupPolicyLevel.UsersAdd) .ToList <UserGroup>()); }
private List <UserGroup> GetExistingNonDefaultGroups(GroupList userGroups) { return(userGroups.Except(GetDefaultGroups(userGroups)) .ToList <UserGroup>()); }