Interface ITeamRepository<TTeamEntity, TMember>
public interface ITeamRepository<TTeamEntity, TMember> : IRepository where TTeamEntity : TeamEntityBase<TMember> where TMember : TeamMemberBase
Type Parameters
TTeamEntityTMember
Methods
AddAsync(TTeamEntity)
Task AddAsync(TTeamEntity teamEntity)
Parameters
teamEntityTTeamEntity
Returns
AddMemberAsync(string, TMember)
Task AddMemberAsync(string teamKey, TMember member)
Parameters
teamKeystringmemberTMember
Returns
DeleteAsync(string)
Task DeleteAsync(string teamKey)
Parameters
teamKeystring
Returns
GetAllTeamsAsync()
Every team, regardless of membership — backs the cross-team discovery path authorized by Read.
IAsyncEnumerable<TTeamEntity> GetAllTeamsAsync()
Returns
- IAsyncEnumerable<TTeamEntity>
Remarks
Declared with a default implementation so existing custom repositories keep compiling. The default throws rather than returning empty: a silently empty cross-team list is indistinguishable from a working feature that happens to have nothing to show, which hides the missing implementation.
GetAllTeamsIncludingDeletedAsync()
Every team including soft-deleted ones — the only read that sees them, for restore and purge surfaces.
IAsyncEnumerable<TTeamEntity> GetAllTeamsIncludingDeletedAsync()
Returns
- IAsyncEnumerable<TTeamEntity>
Remarks
Deliberately a separate method rather than a flag on GetAllTeamsAsync(). A boolean parameter defaulting to "exclude" is one forgotten argument away from leaking deleted teams into an ordinary list; a distinct name has to be chosen on purpose.
GetAsync(string)
Task<TTeamEntity> GetAsync(string teamKey)
Parameters
teamKeystring
Returns
- Task<TTeamEntity>
GetByInviteKeyAsync(string)
The single live team holding an outstanding invitation with this code, or null when none or more than
one does. Backed by the Members.Invitation.InviteKey index.
Task<TTeamEntity> GetByInviteKeyAsync(string inviteKey)
Parameters
inviteKeystring
Returns
- Task<TTeamEntity>
GetIncludingDeletedAsync(string)
Marks a team deleted, or clears the mark when deletedAt is null.
Task<TTeamEntity> GetIncludingDeletedAsync(string teamKey)
Parameters
teamKeystring
Returns
- Task<TTeamEntity>
Remarks
Declared with a default implementation so existing custom repositories keep compiling — and it throws rather than no-opping, because a soft delete that silently does nothing reports success while leaving the team live and readable, which is worse than refusing.
A repository that does not implement this makes its service report
SupportsSoftDelete = false, so the throw is unreachable through the normal path: the delete
resolves to the irreversible one the store already had.
GetTeamsByConsentAsync(string[])
IAsyncEnumerable<TTeamEntity> GetTeamsByConsentAsync(string[] roles)
Parameters
rolesstring[]
Returns
- IAsyncEnumerable<TTeamEntity>
GetTeamsByUserAsync(string)
IAsyncEnumerable<TTeamEntity> GetTeamsByUserAsync(string userKey)
Parameters
userKeystring
Returns
- IAsyncEnumerable<TTeamEntity>
RemoveMemberAsync(string, string)
Task RemoveMemberAsync(string teamKey, string userKey)
Parameters
Returns
RemoveMemberFromAllTeamsAsync(string)
Removes the user's member entries from every team they appear in, regardless of membership state. Backs user deletion. Returns the number of teams the user was removed from.
Task<int> RemoveMemberFromAllTeamsAsync(string userKey)
Parameters
userKeystring
Returns
Remarks
Declared with a default implementation so existing custom repositories keep compiling. The default throws rather than returning 0: a silent no-op on a deletion path would leave memberships behind while reporting success.
RenameAsync(string, string)
Task RenameAsync(string teamKey, string name)
Parameters
Returns
SetConsentAsync(string, string[], AccessLevel?)
Task SetConsentAsync(string teamKey, string[] consentedRoles, AccessLevel? accessLevel = null)
Parameters
teamKeystringconsentedRolesstring[]accessLevelAccessLevel?
Returns
SetCustomRolesAsync(string, IReadOnlyList<TenantRoleDefinition>)
Task SetCustomRolesAsync(string teamKey, IReadOnlyList<TenantRoleDefinition> customRoles)
Parameters
teamKeystringcustomRolesIReadOnlyList<TenantRoleDefinition>
Returns
SetDeletedAsync(string, DateTime?, string)
Task SetDeletedAsync(string teamKey, DateTime? deletedAt, string deletedBy)
Parameters
Returns
SetIconAsync(string, string)
Task SetIconAsync(string teamKey, string reference)
Parameters
Returns
SetInvitationExpiryAsync(string, string, DateTime?)
Sets the expiry of the invitation matching inviteKey, leaving the code itself
untouched so an already-mailed link keeps working.
Task SetInvitationExpiryAsync(string teamKey, string inviteKey, DateTime? expiresAt)
Parameters
Returns
Remarks
A default interface method that no-ops, so a host with its own repository keeps compiling. The base service that calls it throws when it is not overridden, so the gap surfaces as an error at the point of use rather than as an extension that quietly did nothing.
SetInvitationResponseAsync(string, string, string, bool)
Task<ITeam> SetInvitationResponseAsync(string teamKey, string userKey, string inviteKey, bool accept)
Parameters
Returns
SetLastSeenAsync(string, string, DateTime)
Task SetLastSeenAsync(string teamKey, string userKey, DateTime utcNow)
Parameters
Returns
SetMemberNameAsync(string, string, string)
Task SetMemberNameAsync(string teamKey, string userKey, string name)
Parameters
Returns
SetMemberRoleAsync(string, string, AccessLevel)
Task SetMemberRoleAsync(string teamKey, string userKey, AccessLevel accessLevel)
Parameters
teamKeystringuserKeystringaccessLevelAccessLevel
Returns
SetMemberScopeOverridesAsync(string, string, string[])
Task SetMemberScopeOverridesAsync(string teamKey, string userKey, string[] scopeOverrides)
Parameters
Returns
SetMemberSuspendedAsync(string, string, DateTime?, string)
Task SetMemberSuspendedAsync(string teamKey, string userKey, DateTime? suspendedAt, string suspendedBy)
Parameters
Returns
SetMemberTenantRolesAsync(string, string, string[])
Task SetMemberTenantRolesAsync(string teamKey, string userKey, string[] tenantRoles)