Interface IAssociationService
The IAssociationService interface describes a component supporting the management of resource associations within groups.
Namespace: EPiServer.Social.Groups.Core
Assembly: EPiServer.Social.Groups.Core.dll
Version: 1.5.4Syntax
public interface IAssociationService
Methods
Add(Association)
Adds an association between a resource and an existing group.
Declaration
Association Add(Association association)
Parameters
| Type | Name | Description |
|---|---|---|
| Association | association | Association to be added |
Returns
| Type | Description |
|---|---|
| Association | Association of the group |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| GroupDoesNotExistException | Thrown when the group specified for association being added does not exist. |
| DuplicateAssociationException | Thrown when an association already exists between the resource and the group. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Add<TExtension>(Association, TExtension)
Adds an association between a resource with extension data and an existing group.
Declaration
Composite<Association, TExtension> Add<TExtension>(Association association, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Association | association | Association to be added |
| TExtension | extension | Extension data to be added |
Returns
| Type | Description |
|---|---|
| Composite<Association, TExtension> | Composite of Association and extension data which was added |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| GroupDoesNotExistException | Thrown when the group specified for association being added does not exist. |
| DuplicateAssociationException | Thrown when an association already exists between the resource and the group. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
AddAsync(Association)
Asynchronously adds an association between a resource and an existing group.
Declaration
Task<Association> AddAsync(Association association)
Parameters
| Type | Name | Description |
|---|---|---|
| Association | association | Association to be added |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Association> | Association of the group |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| GroupDoesNotExistException | Thrown when the group specified for association being added does not exist. |
| DuplicateAssociationException | Thrown when an association already exists between the resource and the group. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
AddAsync<TExtension>(Association, TExtension)
Asynchronously adds an association between a resource with extension data and an existing group.
Declaration
Task<Composite<Association, TExtension>> AddAsync<TExtension>(Association association, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Association | association | Association to be added |
| TExtension | extension | Extension data to be added |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Association, TExtension>> | Composite of Association and extension data which was added |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| GroupDoesNotExistException | Thrown when the group specified for association being added does not exist. |
| DuplicateAssociationException | Thrown when an association already exists between the resource and the group. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Get(Criteria<AssociationFilter>)
Retrieves a page of associations assigned to the specified group.
Declaration
ResultPage<Association> Get(Criteria<AssociationFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<AssociationFilter> | criteria | Filters the result set of associations |
Returns
| Type | Description |
|---|---|
| ResultPage<Association> | Page of associations for the specified group |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| InvalidPageInfoException | Thrown when the page info is invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Get(AssociationId)
Retrieves a single Assocation based upon an AssociationId
Declaration
Association Get(AssociationId id)
Parameters
| Type | Name | Description |
|---|---|---|
| AssociationId | id | association id of the desired association |
Returns
| Type | Description |
|---|---|
| Association | The requested association |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| AssociationDoesNotExistException | Thrown when the identified association does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Get<TExtension>(CompositeCriteria<AssociationFilter, TExtension>)
Retrieves a page of group associations and extension data assigned to the specified group, as described by the specified criteria.
Declaration
ResultPage<Composite<Association, TExtension>> Get<TExtension>(CompositeCriteria<AssociationFilter, TExtension> criteria)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| CompositeCriteria<AssociationFilter, TExtension> | criteria |
Returns
| Type | Description |
|---|---|
| ResultPage<Composite<Association, TExtension>> | A result page of type composite of type group and extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| InvalidPageInfoException | Thrown when the page info is invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Get<TExtension>(AssociationId)
Gets an association composed with associated extension data, as identified by the specified ID.
Declaration
Composite<Association, TExtension> Get<TExtension>(AssociationId id)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| AssociationId | id | ID of the item to be retrieved |
Returns
| Type | Description |
|---|---|
| Composite<Association, TExtension> | A association composed with associated extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type of data applied as an extension of the association |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| AssociationDoesNotExistException | Thrown when the identified association does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
GetAsync(Criteria<AssociationFilter>)
Asynchronously retrieves a page of associations assigned to the specified group.
Declaration
Task<ResultPage<Association>> GetAsync(Criteria<AssociationFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<AssociationFilter> | criteria | Filters the result set of associations |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ResultPage<Association>> | Page of associations for the specified group |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| InvalidPageInfoException | Thrown when the page info is invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
GetAsync(AssociationId)
Asynchronously retrieves a single Assocation based upon an AssociationId
Declaration
Task<Association> GetAsync(AssociationId id)
Parameters
| Type | Name | Description |
|---|---|---|
| AssociationId | id | association id of the desired association |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Association> | The requested association |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| AssociationDoesNotExistException | Thrown when the identified association does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
GetAsync<TExtension>(CompositeCriteria<AssociationFilter, TExtension>)
Asynchronously retrieves a page of group associations and extension data assigned to the specified group, as described by the specified criteria.
Declaration
Task<ResultPage<Composite<Association, TExtension>>> GetAsync<TExtension>(CompositeCriteria<AssociationFilter, TExtension> criteria)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| CompositeCriteria<AssociationFilter, TExtension> | criteria |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ResultPage<Composite<Association, TExtension>>> | A result page of type composite of type group and extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| InvalidPageInfoException | Thrown when the page info is invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
GetAsync<TExtension>(AssociationId)
Asynchronously gets an association composed with associated extension data, as identified by the specified ID.
Declaration
Task<Composite<Association, TExtension>> GetAsync<TExtension>(AssociationId id)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| AssociationId | id | ID of the item to be retrieved |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Association, TExtension>> | A association composed with associated extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type of data applied as an extension of the association |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| AssociationDoesNotExistException | Thrown when the identified association does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
IsAssociated(GroupId, Reference)
Returns true if the specified resource is associated with the specified group, false otherwise.
Declaration
bool IsAssociated(GroupId group, Reference resource)
Parameters
| Type | Name | Description |
|---|---|---|
| GroupId | group | Group with which the resource may be associated |
| Reference | resource | Identifies the resource whose association should be verified |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the specified resource is associated with the specified group, false otherwise. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are null or invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
IsAssociatedAsync(GroupId, Reference)
Asynchronously determines if the specified resource is associated with the specified group, and returns true if the association exists, false otherwise.
Declaration
Task<bool> IsAssociatedAsync(GroupId group, Reference resource)
Parameters
| Type | Name | Description |
|---|---|---|
| GroupId | group | Group with which the resource may be associated |
| Reference | resource | Identifies the resource whose association should be verified |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Boolean> | True if the specified resource is associated with the specified group, false otherwise. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are null or invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Remove(AssociationId)
Removes an association from an existing group.
Declaration
void Remove(AssociationId associationId)
Parameters
| Type | Name | Description |
|---|---|---|
| AssociationId | associationId | ID of the association to be removed |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are null or invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
RemoveAsync(AssociationId)
Asynchronously removes an association from an existing group.
Declaration
Task RemoveAsync(AssociationId associationId)
Parameters
| Type | Name | Description |
|---|---|---|
| AssociationId | associationId | ID of the association to be removed |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are null or invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Update<TExtension>(AssociationId, TExtension)
Update an association in the repository with new extension data
Declaration
Composite<Association, TExtension> Update<TExtension>(AssociationId associationId, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| AssociationId | associationId | AssociationId used to filter collection with |
| TExtension | extension | Extension data to be added |
Returns
| Type | Description |
|---|---|
| Composite<Association, TExtension> | Composite of Member of the group and extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| AssociationDoesNotExistException | Thrown when the specified association identifier does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
UpdateAsync<TExtension>(AssociationId, TExtension)
Asynchronously update an association in the repository with new extension data
Declaration
Task<Composite<Association, TExtension>> UpdateAsync<TExtension>(AssociationId associationId, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| AssociationId | associationId | AssociationId used to filter collection with |
| TExtension | extension | Extension data to be added |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Association, TExtension>> | Composite of Member of the group and extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| AssociationDoesNotExistException | Thrown when the specified association identifier does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |