Class ModuleStore<TContext>
Represents a new instance of a persistence store for modules.
Inherited Members
Namespace: IRM.AspNetCore.Identity.EntityFrameworkCore
Assembly: IRM.AspNetCore.Identity.EntityFrameworkCore.dll
Syntax
public class ModuleStore<TContext> : IModuleStore, IDisposable, IUseExecutionStrategy where TContext : DbContext
Type Parameters
TContext
The type of the data context class used to access the store. |
Constructors
ModuleStore(TContext, IEnumerable<IPermissionStore>, IdentityErrorDescriber)
Creates a new instance of ModuleStore<TContext>.
Declaration
public ModuleStore(TContext context, IEnumerable<IPermissionStore> permissionStores, IdentityErrorDescriber describer = null)
Parameters
TContext
context
The context used to access the store. |
IEnumerable<IPermissionStore>
permissionStores
Stores that has permissions in any way. |
Microsoft.AspNetCore.Identity.IdentityErrorDescriber
describer
The Microsoft.AspNetCore.Identity.IdentityErrorDescriber used to describe store errors. |
Properties
BoughtModules
A navigation property for the bought modules the store contains.
Declaration
public virtual IQueryable<BoughtModule> BoughtModules { get; }
Property Value
System.Linq.IQueryable<BoughtModule>
|
Context
Gets the database context for this store.
Declaration
public TContext Context { get; }
Property Value
TContext
|
Functionalities
A navigation property for the modules the store contains.
Declaration
public virtual IQueryable<Functionality> Functionalities { get; }
Property Value
System.Linq.IQueryable<Functionality>
|
Modules
A navigation property for the modules the store contains.
Declaration
public virtual IQueryable<Module> Modules { get; }
Property Value
System.Linq.IQueryable<Module>
|
RoleTemplates
A navigation property for the role templates the store contains.
Declaration
public virtual IQueryable<RoleTemplate> RoleTemplates { get; }
Property Value
System.Linq.IQueryable<RoleTemplate>
|
Methods
CreateAsync(BoughtModule, CancellationToken)
Creates the specified boughtModule
in the module store.
Declaration
public virtual async Task<IdentityResult> CreateAsync(BoughtModule boughtModule, CancellationToken cancellationToken = default(CancellationToken))
Parameters
BoughtModule
boughtModule
The bought module to create. |
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
System.Threading.Tasks.Task<IdentityResult>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the IdentityResult of the creation operation. |
Implements
CreateAsync(Module, CancellationToken)
Creates the specified module
in the module store.
Declaration
public virtual async Task<IdentityResult> CreateAsync(Module module, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Module
module
The module to create. |
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
System.Threading.Tasks.Task<IdentityResult>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the IdentityResult of the creation operation. |
Implements
DeleteAsync(Module, CancellationToken)
Deletes a module from the store as an asynchronous operation.
Declaration
public virtual async Task<IdentityResult> DeleteAsync(Module module, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Module
module
The module to delete from the store. |
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
System.Threading.Tasks.Task<IdentityResult>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the IdentityResult of the creation operation. |
Implements
DeleteFunctionalityAsync(Functionality, CancellationToken)
Deletes a functionality from the store as an asynchronous operation.
Declaration
public async Task<IdentityResult> DeleteFunctionalityAsync(Functionality functionality, CancellationToken cancellationToken)
Parameters
Functionality
functionality
The functionality to delete from the store. |
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
System.Threading.Tasks.Task<IdentityResult>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the IdentityResult of the creation operation. |
Implements
Dispose()
Releases all resources used by the store.
Declaration
public void Dispose()
Implements
Dispose(Boolean)
Releases the unmanaged resources used by the module store 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. |
FindBoughtModulesByTenantAsync(Guid, CancellationToken)
Finds and returns all bought modules, if any, for the specified tenantId
.
Declaration
public virtual Task<List<BoughtModule>> FindBoughtModulesByTenantAsync(Guid tenantId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.Guid
tenantId
The tenant ID to search for bought modules. |
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
System.Threading.Tasks.Task<List<BoughtModule>>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the bought module for the specified |
Implements
FindByIdAsync(Guid, CancellationToken)
Finds and returns a module, if any, who has the specified moduleId
.
Declaration
public virtual Task<Module> FindByIdAsync(Guid moduleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.Guid
moduleId
The module ID to search for. |
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
System.Threading.Tasks.Task<Module>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the module matching the specified |
Implements
FindByNameAsync(String, CancellationToken)
Gets the module, if any, associated with the specified name.
Declaration
public virtual Task<Module> FindByNameAsync(string moduleName, CancellationToken cancellationToken = default(CancellationToken))
Parameters
String
moduleName
The module name to search for. |
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
System.Threading.Tasks.Task<Module>
The task object containing the results of the asynchronous lookup operation, the module if any associated with the specified module name. |
Implements
FindFunctionalityForModulesAsync(Guid[], CancellationToken)
Finds and returns all functionality, if any, for the specified moduleIds
.
Declaration
public virtual Task<List<Functionality>> FindFunctionalityForModulesAsync(Guid[] moduleIds, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.Guid[]
moduleIds
An array of module id to get functionality for. |
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
System.Threading.Tasks.Task<List<Functionality>>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the functionalities for the specified |
Implements
Remarks
If no moduleIds
is specified, then all functionality will be returned.
GetAllAsync(ModuleSearchQuery, CancellationToken)
Gets all available modules.
Declaration
public virtual Task<QueryResult<Module>> GetAllAsync(ModuleSearchQuery query, CancellationToken cancellationToken = default(CancellationToken))
Parameters
ModuleSearchQuery
query
The ModuleSearchQuery used to limit the returned result. |
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
System.Threading.Tasks.Task<QueryResult<Module>>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing modules. |
Implements
GetModule(Expression<Func<Module, Boolean>>, CancellationToken)
Gets a module with default includes for this store implementation.
Declaration
protected virtual async Task<Module> GetModule(Expression<Func<Module, bool>> predicate, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Expression<System.Func<Module, Boolean>>
predicate
A function to test each element for a condition. |
System.Threading.CancellationToken
cancellationToken
A System.Threading.CancellationToken to observe while waiting for the task to complete. |
Returns
System.Threading.Tasks.Task<Module>
|
SaveChangesAsync(CancellationToken)
Saves the current store.
Declaration
protected virtual Task SaveChangesAsync(CancellationToken cancellationToken)
Parameters
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
System.Threading.Tasks.Task
The System.Threading.Tasks.Task that represents the asynchronous operation. |
ThrowIfDisposed()
Throws an System.ObjectDisposedException if the audit store is disposed.
Declaration
protected void ThrowIfDisposed()
UpdateAsync(Module, CancellationToken)
Updates a module in a store as an asynchronous operation.
Declaration
public virtual async Task<IdentityResult> UpdateAsync(Module module, CancellationToken cancellationToken)
Parameters
Module
module
The module to update in the store. |
System.Threading.CancellationToken
cancellationToken
The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled. |
Returns
System.Threading.Tasks.Task<IdentityResult>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the IdentityResult for the update. |
Implements
Explicit Interface Implementations
IUseExecutionStrategy.Strategy
Declaration
IExecutionStrategy IUseExecutionStrategy.Strategy { get; }
Returns
IExecutionStrategy
|