Table of Contents

Class UserServiceRepositoryBase<TUserEntity>

Namespace
Tharga.Team.MongoDB
Assembly
Tharga.Team.MongoDB.dll
public abstract class UserServiceRepositoryBase<TUserEntity> : UserServiceBase, IUserService where TUserEntity : EntityBase, IUser

Type Parameters

TUserEntity
Inheritance
UserServiceRepositoryBase<TUserEntity>
Implements
Inherited Members

Constructors

UserServiceRepositoryBase(AuthenticationStateProvider, IUserRepository<TUserEntity>, ILogger<UserServiceBase>, IIconStore)

protected UserServiceRepositoryBase(AuthenticationStateProvider authenticationStateProvider, IUserRepository<TUserEntity> userRepository, ILogger<UserServiceBase> logger = null, IIconStore iconStore = null)

Parameters

authenticationStateProvider AuthenticationStateProvider
userRepository IUserRepository<TUserEntity>
logger ILogger<UserServiceBase>
iconStore IIconStore

Methods

CreateUserEntityAsync(ClaimsPrincipal, string)

protected abstract Task<TUserEntity> CreateUserEntityAsync(ClaimsPrincipal claimsPrincipal, string identity)

Parameters

claimsPrincipal ClaimsPrincipal
identity string

Returns

Task<TUserEntity>

DeleteUserAsync(string)

Deletes the user record from the store, with no team-membership cleanup — call through DeleteUserAsync(string, bool, CancellationToken), which removes team memberships and audits.

public override Task DeleteUserAsync(string userKey)

Parameters

userKey string

Returns

Task

GetAllAsync()

protected override IAsyncEnumerable<IUser> GetAllAsync()

Returns

IAsyncEnumerable<IUser>

GetUserAsync(ClaimsPrincipal)

protected override Task<IUser> GetUserAsync(ClaimsPrincipal claimsPrincipal)

Parameters

claimsPrincipal ClaimsPrincipal

Returns

Task<IUser>

GetUserByKeyAsync(string)

The user with the given key, or null. The default implementation scans GetAsync(); storage-backed services override it with a direct read.

public override Task<IUser> GetUserByKeyAsync(string userKey)

Parameters

userKey string

Returns

Task<IUser>

SeedUserNameAsync(string, string)

Sets the user's display name only if it is currently null/empty. Used by the invitation-accept flow to promote the admin-entered invitation name into the new user's identity without clobbering an IdP-provided name.

public override Task SeedUserNameAsync(string userKey, string name)

Parameters

userKey string
name string

Returns

Task

SetUserDirectoryIdAsync(string, string)

Links the user to their external-directory id (DirectoryId). Called by the oid backfill (internal self-call) and by directory verification on an email-fallback match (relink). Default is a no-op — stores that track the directory id override it.

public override Task SetUserDirectoryIdAsync(string userKey, string directoryId)

Parameters

userKey string
directoryId string

Returns

Task

SetUserIconReferenceAsync(string, string)

Backs SetOwnIconAsync(byte[], string) / ClearOwnIconAsync() — persists the icon reference (or null to clear) on the user document. Default no-op; stores that track Icon override it.

protected override Task SetUserIconReferenceAsync(string userKey, string reference)

Parameters

userKey string
reference string

Returns

Task

SetUserLastSeenAsync(string, DateTime)

Stamps when the user last made an authenticated request. The automatic throttled stamping is an internal self-call that bypasses the authorization decorator; calling this member from outside requires Manage. The default is a no-op — stores that track LastSeen override it.

public override Task SetUserLastSeenAsync(string userKey, DateTime lastSeen)

Parameters

userKey string
lastSeen DateTime

Returns

Task

SetUserNameAsync(string, string)

Always sets the user's display name. Used by the user self-edit flow where the caller has explicitly chosen a name for themselves.

public override Task SetUserNameAsync(string userKey, string name)

Parameters

userKey string
name string

Returns

Task