Table of Contents

Class TeamMemberRemovalCascade

Namespace
Tharga.Team.Service
Assembly
Tharga.Team.Service.dll

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

participants IEnumerable<ITeamMemberRemovalParticipant>
userService IUserService
logger ILogger<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

teams ITeamService
userKey string

Returns

Task<string[]>

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

teamKeys IEnumerable<string>
userKey string
cancellationToken CancellationToken

Returns

Task

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

teamKey string
userKey string
cancellationToken CancellationToken

Returns

Task

RunForCurrentUserAsync(string, CancellationToken)

Cleans up after the current user left teamKey.

public Task RunForCurrentUserAsync(string teamKey, CancellationToken cancellationToken = default)

Parameters

teamKey string
cancellationToken CancellationToken

Returns

Task