Table of Contents

Class SqliteRoleStore<TRole>

Namespace
Hi.SqliteUtils
Assembly
HiNc.dll

SQLite-based role store for ASP.NET Core Identity.

public class SqliteRoleStore<TRole> : IRoleStore<TRole>, IQueryableRoleStore<TRole>, IRoleStore<TRole>, IDisposable where TRole : SqliteIdentityRole, new()

Type Parameters

TRole

The type of role.

Inheritance
SqliteRoleStore<TRole>
Implements
IRoleStore<TRole>
IRoleStore<TRole>
Inherited Members
Extension Methods

Constructors

SqliteRoleStore(SqliteIdentityStorage)

public SqliteRoleStore(SqliteIdentityStorage storage)

Parameters

storage SqliteIdentityStorage

Properties

Roles

Returns an IQueryable<T> collection of roles.

public IQueryable<TRole> Roles { get; }

Property Value

IQueryable<TRole>

An IQueryable<T> collection of roles.

Methods

CreateAsync(TRole, CancellationToken)

Creates a new role in a store as an asynchronous operation.

public Task<IdentityResult> CreateAsync(TRole role, CancellationToken cancellationToken)

Parameters

role TRole

The role to create in the store.

cancellationToken CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

Task<IdentityResult>

A Task<TResult> that represents the IdentityResult of the asynchronous query.

DeleteAsync(TRole, CancellationToken)

Deletes a role from the store as an asynchronous operation.

public Task<IdentityResult> DeleteAsync(TRole role, CancellationToken cancellationToken)

Parameters

role TRole

The role to delete from the store.

cancellationToken CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

Task<IdentityResult>

A Task<TResult> that represents the IdentityResult of the asynchronous query.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

FindByIdAsync(string, CancellationToken)

Finds the role who has the specified ID as an asynchronous operation.

public Task<TRole> FindByIdAsync(string roleId, CancellationToken cancellationToken)

Parameters

roleId string

The role ID to look for.

cancellationToken CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

Task<TRole>

A Task<TResult> that result of the look up.

FindByNameAsync(string, CancellationToken)

Finds the role who has the specified normalized name as an asynchronous operation.

public Task<TRole> FindByNameAsync(string normalizedRoleName, CancellationToken cancellationToken)

Parameters

normalizedRoleName string

The normalized role name to look for.

cancellationToken CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

Task<TRole>

A Task<TResult> that result of the look up.

GetNormalizedRoleNameAsync(TRole, CancellationToken)

Get a role's normalized name as an asynchronous operation.

public Task<string> GetNormalizedRoleNameAsync(TRole role, CancellationToken cancellationToken)

Parameters

role TRole

The role whose normalized name should be retrieved.

cancellationToken CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

Task<string>

A Task<TResult> that contains the name of the role.

GetRoleIdAsync(TRole, CancellationToken)

Gets the ID for a role from the store as an asynchronous operation.

public Task<string> GetRoleIdAsync(TRole role, CancellationToken cancellationToken)

Parameters

role TRole

The role whose ID should be returned.

cancellationToken CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

Task<string>

A Task<TResult> that contains the ID of the role.

GetRoleNameAsync(TRole, CancellationToken)

Gets the name of a role from the store as an asynchronous operation.

public Task<string> GetRoleNameAsync(TRole role, CancellationToken cancellationToken)

Parameters

role TRole

The role whose name should be returned.

cancellationToken CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

Task<string>

A Task<TResult> that contains the name of the role.

SetNormalizedRoleNameAsync(TRole, string, CancellationToken)

Set a role's normalized name as an asynchronous operation.

public Task SetNormalizedRoleNameAsync(TRole role, string normalizedName, CancellationToken cancellationToken)

Parameters

role TRole

The role whose normalized name should be set.

normalizedName string

The normalized name to set

cancellationToken CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

Task

The Task that represents the asynchronous operation.

SetRoleNameAsync(TRole, string, CancellationToken)

Sets the name of a role in the store as an asynchronous operation.

public Task SetRoleNameAsync(TRole role, string roleName, CancellationToken cancellationToken)

Parameters

role TRole

The role whose name should be set.

roleName string

The name of the role.

cancellationToken CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

Task

The Task that represents the asynchronous operation.

UpdateAsync(TRole, CancellationToken)

Updates a role in a store as an asynchronous operation.

public Task<IdentityResult> UpdateAsync(TRole role, CancellationToken cancellationToken)

Parameters

role TRole

The role to update in the store.

cancellationToken CancellationToken

The CancellationToken used to propagate notifications that the operation should be canceled.

Returns

Task<IdentityResult>

A Task<TResult> that represents the IdentityResult of the asynchronous query.