Interface IUserRepository<TUserEntity>
public interface IUserRepository<TUserEntity> : IRepository where TUserEntity : EntityBase, IUser
Type Parameters
TUserEntity
Methods
AddAsync(TUserEntity)
Task AddAsync(TUserEntity user)
Parameters
userTUserEntity
Returns
DeleteAsync(string)
Deletes the user document.
Task DeleteAsync(string userKey)
Parameters
userKeystring
Returns
Remarks
Declared with a default implementation so existing custom repositories keep compiling. The default throws rather than no-opping: silently skipping a requested deletion would hide the missing implementation behind an apparently successful call.
GetAsync()
IAsyncEnumerable<TUserEntity> GetAsync()
Returns
- IAsyncEnumerable<TUserEntity>
GetAsync(string)
Task<TUserEntity> GetAsync(string identity)
Parameters
identitystring
Returns
- Task<TUserEntity>
GetByKeyAsync(string)
Task<TUserEntity> GetByKeyAsync(string userKey)
Parameters
userKeystring
Returns
- Task<TUserEntity>
SetDirectoryIdAsync(string, string)
Sets DirectoryId on the user document. Same opt-in-by-entity-shape contract
as SetLastSeenAsync(string, DateTime): a no-op unless the entity declares a DirectoryId property.
Task SetDirectoryIdAsync(string userKey, string directoryId)
Parameters
Returns
SetIconAsync(string, string)
Sets Icon (the icon reference) on the user document. Same opt-in-by-entity-shape
contract as SetDirectoryIdAsync(string, string): a no-op unless the entity declares an Icon property.
Task SetIconAsync(string userKey, string reference)
Parameters
Returns
SetLastSeenAsync(string, DateTime)
Stamps LastSeen on the user document. Called automatically by the throttled
resolve path, so the default (and the built-in repository, when TUserEntity
does not declare a LastSeen property) is a no-op — activity tracking is opted into by
declaring the property on the entity.
Task SetLastSeenAsync(string userKey, DateTime lastSeen)
Parameters
Returns
SetNameAsync(string, string)
Task SetNameAsync(string userKey, string name)