Class UserSearchStore<TListUser, TUser, TPerson, TContext>
Represents a persistence store for the combined user and person, used to list or search for users.
Inherited Members
Namespace: IRM.AspNetCore.Identity.EntityFrameworkCore
Assembly: IRM.AspNetCore.Identity.EntityFrameworkCore.dll
Syntax
public class UserSearchStore<TListUser, TUser, TPerson, TContext> : IUserSearchStore<TListUser>, IDisposable where TListUser : class, IListUser, new()
where TUser : IdentityUser where TPerson : class, IPerson where TContext : DbContext, IUserSearchDbContext<TUser, TPerson>
Type Parameters
|
TListUser
The type representing a combined user and person. |
|
TUser
The type representing a user. |
|
TPerson
The type representing a person. |
|
TContext
The type of the data context class used to access the store. |
Constructors
UserSearchStore(TContext)
Creates a new instance of UserSearchStore<TListUser, TUser, TPerson, TContext>.
Declaration
public UserSearchStore(TContext context)
Parameters
|
TContext
context
The context used to access the store. |
Properties
Context
Gets the context used to access the store.
Declaration
protected TContext Context { get; }
Property Value
|
TContext
|
Methods
AddSearchTerms(IQueryable<UserSearchStore<TListUser, TUser, TPerson, TContext>.TempSearchResult>, IUsersSearchQuery)
Declaration
protected virtual IQueryable<UserSearchStore<TListUser, TUser, TPerson, TContext>.TempSearchResult> AddSearchTerms(IQueryable<UserSearchStore<TListUser, TUser, TPerson, TContext>.TempSearchResult> linqQuery, IUsersSearchQuery query)
Parameters
|
System.Linq.IQueryable<UserSearchStore.TempSearchResult<>>
linqQuery
|
|
IUsersSearchQuery
query
|
Returns
|
System.Linq.IQueryable<UserSearchStore.TempSearchResult<>>
|
AddSortingAndPageing(IQueryable<UserSearchStore<TListUser, TUser, TPerson, TContext>.TempSearchResult>, Query)
Declaration
protected virtual IQueryable<UserSearchStore<TListUser, TUser, TPerson, TContext>.TempSearchResult> AddSortingAndPageing(IQueryable<UserSearchStore<TListUser, TUser, TPerson, TContext>.TempSearchResult> linqQuery, Query query)
Parameters
|
System.Linq.IQueryable<UserSearchStore.TempSearchResult<>>
linqQuery
|
|
Query
query
|
Returns
|
System.Linq.IQueryable<UserSearchStore.TempSearchResult<>>
|
Dispose()
Releases all resources used by the store.
Declaration
public void Dispose()
Implements
Dispose(Boolean)
Releases the unmanaged resources used by the organisation manager and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
|
Boolean
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources. |
GetAllUsersAsync(UsersSearchQuery, CancellationToken)
Gets all users that matches the supplied query.
Declaration
public virtual Task<QueryResult<TListUser>> GetAllUsersAsync(UsersSearchQuery query, CancellationToken cancellationToken = default(CancellationToken))
Parameters
|
UsersSearchQuery
query
The query describing filtering and sorting for the users. |
|
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
|
System.Threading.Tasks.Task<QueryResult<TListUser>>
A QueryResult<T> with a collection of users matching the supplied |
Implements
GetUsersInRoleAsync(UsersInRoleSearchQuery, CancellationToken)
Gets all users that matches the supplied query and the specified role.
Declaration
public virtual Task<QueryResult<TListUser>> GetUsersInRoleAsync(UsersInRoleSearchQuery query, CancellationToken cancellationToken = default(CancellationToken))
Parameters
|
UsersInRoleSearchQuery
query
The query describing the role id, filtering and sorting for the users. |
|
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
|
System.Threading.Tasks.Task<QueryResult<TListUser>>
A QueryResult<T> with a collection of users matching the supplied |
Implements
MapSearchResult(TPerson, ListOrganisation, TUser)
Declaration
protected static TListUser MapSearchResult(TPerson person, ListOrganisation organisation, TUser user)
Parameters
|
TPerson
person
|
|
ListOrganisation
organisation
|
|
TUser
user
|
Returns
|
TListUser
|
ReturnPagedResult(IQueryable<UserSearchStore<TListUser, TUser, TPerson, TContext>.TempSearchResult>, Query)
Declaration
protected Task<QueryResult<TListUser>> ReturnPagedResult(IQueryable<UserSearchStore<TListUser, TUser, TPerson, TContext>.TempSearchResult> q, Query query)
Parameters
|
System.Linq.IQueryable<UserSearchStore.TempSearchResult<>>
q
|
|
Query
query
|
Returns
|
System.Threading.Tasks.Task<QueryResult<TListUser>>
|
ThrowIfDisposed()
Throws an System.ObjectDisposedException if the person store is disposed.
Declaration
protected void ThrowIfDisposed()