Interface IRoleRepository
The IRoleRepository interface describes a component capable of persisting, deleting, and retrieving role data from an underlying data store.
Namespace: EPiServer.Social.Groups.Core
Assembly: EPiServer.Social.Groups.Core.dll
Version: 1.5.4Syntax
public interface IRoleRepository
Methods
Add(Role)
Adds a user as a role to the repository to the underlying data store
Declaration
Role Add(Role role)
Parameters
| Type | Name | Description |
|---|---|---|
| Role | role | Role to be added |
Returns
| Type | Description |
|---|---|
| Role | Role of the role |
Add<TExtension>(Role, TExtension)
Adds a user as a role and its corresponding extension data to the underlying data store
Declaration
Composite<Role, TExtension> Add<TExtension>(Role role, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Role | role | Role to be added |
| TExtension | extension | extension data to be added |
Returns
| Type | Description |
|---|---|
| Composite<Role, TExtension> | Composite of Role of the role and extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
AddAsync(Role)
Asynchronously adds a role within the underlying data store.
Declaration
Task<Role> AddAsync(Role role)
Parameters
| Type | Name | Description |
|---|---|---|
| Role | role | Role to be added |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Role> | Role which was added |
AddAsync<TExtension>(Role, TExtension)
Asynchronously adds a user as a role and its corresponding extension data to the underlying data store
Declaration
Task<Composite<Role, TExtension>> AddAsync<TExtension>(Role role, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Role | role | Role to be added |
| TExtension | extension | extension data to be added |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Role, TExtension>> | Composite of Role of the role and extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Assign(RoleAssignment)
Assigns a role to the specified role.
Declaration
void Assign(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Identifies the role the role, which they are to be assigned |
AssignAsync(RoleAssignment)
Assigns a role to the specified role.
Declaration
Task AssignAsync(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Identifies the role the role, which they are to be assigned |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Get(Criteria<RoleFilter>)
Retrieves a result page of roles assigned to the specified role from the underlying data store
Declaration
ResultPage<Role> Get(Criteria<RoleFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<RoleFilter> | criteria | Filters the result set of roles |
Returns
| Type | Description |
|---|---|
| ResultPage<Role> | Page of roles of the specified role |
Get(RoleId)
Gets a role of an existing role from the underlying data store
Declaration
Role Get(RoleId roleId)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | ID of the role to be retrieved |
Returns
| Type | Description |
|---|---|
| Role | Role with the specified ID |
Get<TExtension>(CompositeCriteria<RoleFilter, TExtension>)
Retrieves a result page of roles assigned to the specified role and their extension data from the underlying data store
Declaration
ResultPage<Composite<Role, TExtension>> Get<TExtension>(CompositeCriteria<RoleFilter, TExtension> criteria)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| CompositeCriteria<RoleFilter, TExtension> | criteria | Composite Criteria that contains Filters for the result set of roles and extension |
Returns
| Type | Description |
|---|---|
| ResultPage<Composite<Role, TExtension>> | Page of roles of the specified role and their corresponding extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Get<TExtension>(RoleId)
Gets a role of an existing role and its corresponding extension data from the underlying data store
Declaration
Composite<Role, TExtension> Get<TExtension>(RoleId roleId)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | ID of the role to be retrieved |
Returns
| Type | Description |
|---|---|
| Composite<Role, TExtension> | Composite of role and extension data for the specified ID |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
GetAsync(Criteria<RoleFilter>)
Asynchronously retrieves a page of roles, from the underlying data store, as specified by the provided criteria.
Declaration
Task<ResultPage<Role>> GetAsync(Criteria<RoleFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<RoleFilter> | criteria | Filters the result set of roles |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ResultPage<Role>> | Page of roles filtered according to the specified criteria |
GetAsync(RoleId)
Asynchronously retrieves a role, represented by the specified ID, from the underlying data store.
Declaration
Task<Role> GetAsync(RoleId roleId)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | ID fo the role to be retrieved |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Role> | Role which was retrieved |
GetAsync<TExtension>(CompositeCriteria<RoleFilter, TExtension>)
Asynchronously retrieves a result page of composites. Each composite contains a role and its extension data, from the underlying data store, as specified by the provided criteria.
Declaration
Task<ResultPage<Composite<Role, TExtension>>> GetAsync<TExtension>(CompositeCriteria<RoleFilter, TExtension> criteria)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| CompositeCriteria<RoleFilter, TExtension> | criteria | Filters the result set of roles and the extension data |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ResultPage<Composite<Role, TExtension>>> | Page of composites that contain roles and their extension data filtered according to the specified criteria |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
GetAsync<TExtension>(RoleId)
Asynchronously retrieves a role with extension data, represented by the specified ID, from the underlying data store.
Declaration
Task<Composite<Role, TExtension>> GetAsync<TExtension>(RoleId id)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | id | ID fo the role to be retrieved |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Role, TExtension>> | Composite that contains a role and its extension data based on the criteria provided. |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
IsAssigned(RoleAssignment)
Returns true if the specified role has been assigned the specified role, false otherwise.
Declaration
bool IsAssigned(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Identifies the role assigment, which is to be verified |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the role has been assigned the role, false otherwise |
IsAssignedAsync(RoleAssignment)
Returns true if the specified role has been assigned the specified role, false otherwise.
Declaration
Task<bool> IsAssignedAsync(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Identifies the role assigment, which is to be verified |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Boolean> | True if the role has been assigned the role, false otherwise |
Remove(RoleId)
Removes a role from an existing role from the underlying data store
Declaration
void Remove(RoleId roleId)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | ID of the role to be removed |
RemoveAsync(RoleId)
Asynchronously removes an existing role from the underlying data store.
Declaration
Task RemoveAsync(RoleId roleId)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | ID of the role to be removed |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Unassign(RoleAssignment)
Unassigns a role from the specified role.
Declaration
void Unassign(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Identifies the role assigment, which is to be removed |
UnassignAsync(RoleAssignment)
Unassigns a role from the specified role.
Declaration
Task UnassignAsync(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Identifies the role assigment, which is to be removed |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Update<TExtension>(RoleId, TExtension)
Update a role in the repository with new extension data
Declaration
Composite<Role, TExtension> Update<TExtension>(RoleId roleId, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | RoleId used to filter collection with |
| TExtension | extension | Extension data to be added |
Returns
| Type | Description |
|---|---|
| Composite<Role, TExtension> | Composite of Role of the role and extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
UpdateAsync<TExtension>(RoleId, TExtension)
Asynchronously updates an existing role with extension data within the underlying data store
Declaration
Task<Composite<Role, TExtension>> UpdateAsync<TExtension>(RoleId roleId, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | role to be updated |
| TExtension | extension | Extension Data to be updated |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Role, TExtension>> | Role which was updated |
Type Parameters
| Name | Description |
|---|---|
| TExtension |