Class TeamMemberRemovalCascade
Runs every ITeamMemberRemovalParticipant after someone stops being a member of a team.
public sealed class TeamMemberRemovalCascade
- Inheritance
-
TeamMemberRemovalCascade
- Inherited Members
Remarks
A collaborator, not a decorator, like TeamPurgeCascade: invoked from the authorization decorator, which already intercepts every removal path, rather than wrapping Tharga.Team.ITeamService again for three calls.
Never throws. The removal has already happened by the time this runs, so a failure here cannot be reported as a failed removal — that would tell the caller something untrue. It is logged instead.
Constructors
TeamMemberRemovalCascade(IEnumerable<ITeamMemberRemovalParticipant>, IUserService, ILogger<TeamMemberRemovalCascade>)
Runs every ITeamMemberRemovalParticipant after someone stops being a member of a team.
public TeamMemberRemovalCascade(IEnumerable<ITeamMemberRemovalParticipant> participants, IUserService userService = null, ILogger<TeamMemberRemovalCascade> logger = null)
Parameters
participantsIEnumerable<ITeamMemberRemovalParticipant>userServiceIUserServiceloggerILogger<TeamMemberRemovalCascade>
Remarks
A collaborator, not a decorator, like TeamPurgeCascade: invoked from the authorization decorator, which already intercepts every removal path, rather than wrapping Tharga.Team.ITeamService again for three calls.
Never throws. The removal has already happened by the time this runs, so a failure here cannot be reported as a failed removal — that would tell the caller something untrue. It is logged instead.
Methods
GetTeamKeysAsync(ITeamService, string)
The teams userKey is a member of, read before removing them from all of them,
since afterwards there is nothing left to read. Empty, not a failure, when the store cannot answer.
public Task<string[]> GetTeamKeysAsync(ITeamService teams, string userKey)
Parameters
teamsITeamServiceuserKeystring
Returns
RunAsync(IEnumerable<string>, string, CancellationToken)
Cleans up after userKey stopped being a member of each of teamKeys.
public Task RunAsync(IEnumerable<string> teamKeys, string userKey, CancellationToken cancellationToken = default)
Parameters
teamKeysIEnumerable<string>userKeystringcancellationTokenCancellationToken
Returns
RunAsync(string, string, CancellationToken)
Cleans up after userKey stopped being a member of teamKey.
public Task RunAsync(string teamKey, string userKey, CancellationToken cancellationToken = default)
Parameters
teamKeystringuserKeystringcancellationTokenCancellationToken
Returns
RunForCurrentUserAsync(string, CancellationToken)
Cleans up after the current user left teamKey.
public Task RunForCurrentUserAsync(string teamKey, CancellationToken cancellationToken = default)
Parameters
teamKeystringcancellationTokenCancellationToken