S
shapper
Hello,
I have a list of an enumeration: IList<Role> Roles and a variable Role
myRole.
Consider myRole value is Role.A. I need to:
- Add Role.A to IList<Role> only if IList<Role> does not contain
Role.A.
- If I add Role.A to Roles then I need to remove Role.C and Role.F
from list Roles if they exist.
How can I do this?
Thanks,
Miguel
I have a list of an enumeration: IList<Role> Roles and a variable Role
myRole.
Consider myRole value is Role.A. I need to:
- Add Role.A to IList<Role> only if IList<Role> does not contain
Role.A.
- If I add Role.A to Roles then I need to remove Role.C and Role.F
from list Roles if they exist.
How can I do this?
Thanks,
Miguel