Class HttpRoleRepository

Inheritance
System.Object
HttpRoleRepository
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Social.Groups.Rest
Assembly: EPiServer.Social.Groups.Rest.dll
Version: 1.5.4
Syntax
public class HttpRoleRepository : IRoleRepository

Constructors

HttpRoleRepository(IHttpClientFactory, IRoleRequestFactory)

Declaration
public HttpRoleRepository(IHttpClientFactory httpClientFactory, IRoleRequestFactory requestFactory)
Parameters
Type Name Description
IHttpClientFactory httpClientFactory
IRoleRequestFactory requestFactory

Methods

Add(Role)

Adds a new role to the underlying data store.

Declaration
public Role Add(Role role)
Parameters
Type Name Description
Role role

The partially populated role to be added

Returns
Type Description
Role

The fully populated role that was added.

Exceptions
Type Condition
SocialCommunicationException

Thrown when the cloud service cannot be reached.

Add<TExtension>(Role, TExtension)

Adds a new composite role to the underlying data store.

Declaration
public Composite<Role, TExtension> Add<TExtension>(Role role, TExtension extension)
    where TExtension : class
Parameters
Type Name Description
Role role

The partially populated role to be added

TExtension extension
Returns
Type Description
Composite<Role, TExtension>

The fully populated role that was added.

Type Parameters
Name Description
TExtension

Type of extension data for the role being added.

Exceptions
Type Condition
SocialCommunicationException

Thrown when the cloud service cannot be reached.

AddAsync(Role)

Asynchronously adds a new role to the underlying data store.

Declaration
public Task<Role> AddAsync(Role role)
Parameters
Type Name Description
Role role

The partially populated role to be added

Returns
Type Description
System.Threading.Tasks.Task<Role>

The fully populated role that was added.

Exceptions
Type Condition
SocialCommunicationException

Thrown when the cloud service cannot be reached.

AddAsync<TExtension>(Role, TExtension)

Asynchronously adds a new composite role to the underlying data store.

Declaration
public Task<Composite<Role, TExtension>> AddAsync<TExtension>(Role role, TExtension extension)
    where TExtension : class
Parameters
Type Name Description
Role role

The partially populated role to be added

TExtension extension
Returns
Type Description
System.Threading.Tasks.Task<Composite<Role, TExtension>>

The fully populated role that was added.

Type Parameters
Name Description
TExtension

Type of extension data for the role being added.

Exceptions
Type Condition
SocialCommunicationException

Thrown when the cloud service cannot be reached.

Assign(RoleAssignment)

Declaration
public void Assign(RoleAssignment assignment)
Parameters
Type Name Description
RoleAssignment assignment

AssignAsync(RoleAssignment)

Declaration
public Task AssignAsync(RoleAssignment assignment)
Parameters
Type Name Description
RoleAssignment assignment
Returns
Type Description
System.Threading.Tasks.Task

Get(Criteria<RoleFilter>)

Retrieves a page of role items composed without their extension data from the database, as described by the specified criteria.

Declaration
public ResultPage<Role> Get(Criteria<RoleFilter> criteria)
Parameters
Type Name Description
Criteria<RoleFilter> criteria

Criteria by which to filter role items

Returns
Type Description
ResultPage<Role>

Page of role items

Exceptions
Type Condition
SocialCommunicationException

Thrown when the cloud service cannot be reached.

Get(RoleId)

Finds a role by its identifier.

Declaration
public Role Get(RoleId roleId)
Parameters
Type Name Description
RoleId roleId

Id of role to retrieve.

Returns
Type Description
Role

The identified role

Exceptions
Type Condition
RoleDoesNotExistException

Thrown when the identified role does not exist.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

Get<TExtension>(CompositeCriteria<RoleFilter, TExtension>)

Retrieves a page of role items composed with their extension data from the database, as described by the specified criteria. The result set will be filtered to items of the type supplied as a type param.

Declaration
public ResultPage<Composite<Role, TExtension>> Get<TExtension>(CompositeCriteria<RoleFilter, TExtension> criteria)
    where TExtension : class
Parameters
Type Name Description
CompositeCriteria<RoleFilter, TExtension> criteria

Criteria by which to filter role items

Returns
Type Description
ResultPage<Composite<Role, TExtension>>

Page of role items composed with their extension data

Type Parameters
Name Description
TExtension

Type of extension data associated with the items to be retrieved

Exceptions
Type Condition
SocialCommunicationException

Thrown when the cloud service cannot be reached.

Get<TExtension>(RoleId)

Finds a role by its identifier.

Declaration
public Composite<Role, TExtension> Get<TExtension>(RoleId id)
    where TExtension : class
Parameters
Type Name Description
RoleId id

Id of role to retrieve.

Returns
Type Description
Composite<Role, TExtension>

The identified role

Type Parameters
Name Description
TExtension

Type of extension data to retrieve.

Exceptions
Type Condition
RoleDoesNotExistException

Thrown when the identified role does not exist.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

GetAsync(Criteria<RoleFilter>)

Asynchronously retrieves a page of role items composed without their extension data from the database, as described by the specified criteria.

Declaration
public Task<ResultPage<Role>> GetAsync(Criteria<RoleFilter> criteria)
Parameters
Type Name Description
Criteria<RoleFilter> criteria

Criteria by which to filter role items

Returns
Type Description
System.Threading.Tasks.Task<ResultPage<Role>>

Page of role items

Exceptions
Type Condition
SocialCommunicationException

Thrown when the cloud service cannot be reached.

GetAsync(RoleId)

Asynchronously finds a role by its identifier.

Declaration
public Task<Role> GetAsync(RoleId roleId)
Parameters
Type Name Description
RoleId roleId

Id of role to retrieve.

Returns
Type Description
System.Threading.Tasks.Task<Role>

The identified role

Exceptions
Type Condition
RoleDoesNotExistException

Thrown when the identified role does not exist.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

GetAsync<TExtension>(CompositeCriteria<RoleFilter, TExtension>)

Asynchronously retrieves a page of role items composed with their extension data from the database, as described by the specified criteria. The result set will be filtered to items of the type supplied as a type param.

Declaration
public Task<ResultPage<Composite<Role, TExtension>>> GetAsync<TExtension>(CompositeCriteria<RoleFilter, TExtension> criteria)
    where TExtension : class
Parameters
Type Name Description
CompositeCriteria<RoleFilter, TExtension> criteria

Criteria by which to filter role items

Returns
Type Description
System.Threading.Tasks.Task<ResultPage<Composite<Role, TExtension>>>

Page of role items composed with their extension data

Type Parameters
Name Description
TExtension

Type of extension data associated with the items to be retrieved

Exceptions
Type Condition
SocialCommunicationException

Thrown when the cloud service cannot be reached.

GetAsync<TExtension>(RoleId)

Asynchronously finds a role by its identifier.

Declaration
public Task<Composite<Role, TExtension>> GetAsync<TExtension>(RoleId id)
    where TExtension : class
Parameters
Type Name Description
RoleId id

Id of role to retrieve.

Returns
Type Description
System.Threading.Tasks.Task<Composite<Role, TExtension>>

The identified role

Type Parameters
Name Description
TExtension

Type of extension data to retrieve.

Exceptions
Type Condition
RoleDoesNotExistException

Thrown when the identified role does not exist.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

IsAssigned(RoleAssignment)

Declaration
public bool IsAssigned(RoleAssignment assignment)
Parameters
Type Name Description
RoleAssignment assignment
Returns
Type Description
System.Boolean

IsAssignedAsync(RoleAssignment)

Declaration
public Task<bool> IsAssignedAsync(RoleAssignment assignment)
Parameters
Type Name Description
RoleAssignment assignment
Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

Remove(RoleId)

Declaration
public void Remove(RoleId role)
Parameters
Type Name Description
RoleId role

RemoveAsync(RoleId)

Declaration
public Task RemoveAsync(RoleId roleId)
Parameters
Type Name Description
RoleId roleId
Returns
Type Description
System.Threading.Tasks.Task

Unassign(RoleAssignment)

Declaration
public void Unassign(RoleAssignment assignment)
Parameters
Type Name Description
RoleAssignment assignment

UnassignAsync(RoleAssignment)

Declaration
public Task UnassignAsync(RoleAssignment assignment)
Parameters
Type Name Description
RoleAssignment assignment
Returns
Type Description
System.Threading.Tasks.Task

Update<TExtension>(RoleId, TExtension)

Updates a role by its identifier.

Declaration
public Composite<Role, TExtension> Update<TExtension>(RoleId roleId, TExtension extension)
    where TExtension : class
Parameters
Type Name Description
RoleId roleId

id of the role to be updated.

TExtension extension

updated version of the extension data.

Returns
Type Description
Composite<Role, TExtension>

The updated composite

Type Parameters
Name Description
TExtension

Type of extension data for the role being updated.

Exceptions
Type Condition
RoleDoesNotExistException

Thrown when the identified role does not exist.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

UpdateAsync<TExtension>(RoleId, TExtension)

Asynchronously updates a role by its identifier.

Declaration
public Task<Composite<Role, TExtension>> UpdateAsync<TExtension>(RoleId roleId, TExtension extension)
    where TExtension : class
Parameters
Type Name Description
RoleId roleId

id of the role to be updated.

TExtension extension

updated version of the extension data.

Returns
Type Description
System.Threading.Tasks.Task<Composite<Role, TExtension>>

The identified group

Type Parameters
Name Description
TExtension

Type of extension data for the role being updated.

Exceptions
Type Condition
MemberDoesNotExistException

Thrown when the identified role does not exist.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

Implements

arrow_upward