Interface ICommentService
The ICommentService interface supports comment management operations, allowing users to contribute comments to entities in a Social environment.
Namespace: EPiServer.Social.Comments.Core
Assembly: EPiServer.Social.Comments.Core.dll
Version: 1.5.4Syntax
public interface ICommentService
Methods
Add(Comment)
Adds a new comment.
Declaration
Comment Add(Comment comment)
Parameters
| Type | Name | Description |
|---|---|---|
| Comment | comment | Comment to be added |
Returns
| Type | Description |
|---|---|
| Comment | Comment that was added |
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. |
| InvalidCommentException | Thrown when the comment body being added is empty. |
| 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>(Comment, TExtension)
Adds a new comment with supporting metadata to form a composite.
Declaration
Composite<Comment, TExtension> Add<TExtension>(Comment comment, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Comment | comment | Comment to be added |
| TExtension | extension | Extended data related to the comment |
Returns
| Type | Description |
|---|---|
| Composite<Comment, TExtension> | A comment composed with the extended data |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type applied as an extension of the comment |
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. |
| InvalidCommentException | Thrown when the comment body being added is empty. |
| 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(Comment)
Asynchronously adds a new comment.
Declaration
Task<Comment> AddAsync(Comment comment)
Parameters
| Type | Name | Description |
|---|---|---|
| Comment | comment | Comment to be added |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Comment> | Comment that was added |
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. |
| InvalidCommentException | Thrown when the comment body being added is empty. |
| 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>(Comment, TExtension)
Asynchronously adds a new comment with supporting metadata to form a composite.
Declaration
Task<Composite<Comment, TExtension>> AddAsync<TExtension>(Comment comment, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Comment | comment | Comment to be added |
| TExtension | extension | Extended data related to the comment |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Comment, TExtension>> | A comment composed with the extended data |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type applied as an extension of the comment |
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. |
| InvalidCommentException | Thrown when the comment body being added is empty. |
| 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(CommentId)
Gets a comment as identified by the specified ID.
Declaration
Comment Get(CommentId id)
Parameters
| Type | Name | Description |
|---|---|---|
| CommentId | id | ID of the item to be retrieved |
Returns
| Type | Description |
|---|---|
| Comment | The identified Comment |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the comment id passed in is null or empty. |
| CommentDoesNotExistException | Thrown when the identified comment 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(Criteria<CommentFilter>)
Retrieves a collection of comments as specified by the provided criteria.
Declaration
ResultPage<Comment> Get(Criteria<CommentFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<CommentFilter> | criteria | Criteria by which to filter comments |
Returns
| Type | Description |
|---|---|
| ResultPage<Comment> | Page of comments filtered according to the specified criteria |
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>(CommentId)
Gets a comment composed with associated extension data, as identified by the specified ID.
Declaration
Composite<Comment, TExtension> Get<TExtension>(CommentId id)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| CommentId | id | ID of the item to be retrieved |
Returns
| Type | Description |
|---|---|
| Composite<Comment, TExtension> | A comment composed with associated extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type of data applied as an extension of the comment |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the comment id passed in is null or empty. |
| CommentDoesNotExistException | Thrown when the identified comment 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<CommentFilter, TExtension>)
Retrieves a page of comments as specified by the provided criteria. The comments are filtered by the type of their associated data.
Declaration
ResultPage<Composite<Comment, TExtension>> Get<TExtension>(CompositeCriteria<CommentFilter, TExtension> criteria)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| CompositeCriteria<CommentFilter, TExtension> | criteria | Filters the result set of comments |
Returns
| Type | Description |
|---|---|
| ResultPage<Composite<Comment, TExtension>> | Page of composite comments filtered according to the specified criteria |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type of data associated with the desired comments |
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(CommentId)
Asynchronously gets a comment as identified by the specified ID.
Declaration
Task<Comment> GetAsync(CommentId id)
Parameters
| Type | Name | Description |
|---|---|---|
| CommentId | id | ID of the item to be retrieved |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Comment> | The identified Comment |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the comment id passed in is null or empty. |
| CommentDoesNotExistException | Thrown when the identified comment 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<CommentFilter>)
Asynchronously retrieves a collection of comments as specified by the provided criteria.
Declaration
Task<ResultPage<Comment>> GetAsync(Criteria<CommentFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<CommentFilter> | criteria | Criteria by which to filter comments |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ResultPage<Comment>> | Page of comments filtered according to the specified criteria |
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>(CommentId)
Asynchronously gets a comment composed with associated extension data, as identified by the specified ID.
Declaration
Task<Composite<Comment, TExtension>> GetAsync<TExtension>(CommentId id)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| CommentId | id | ID of the item to be retrieved |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Comment, TExtension>> | A comment composed with associated extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type of data applied as an extension of the comment |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the comment id passed in is null or empty. |
| CommentDoesNotExistException | Thrown when the identified comment 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<CommentFilter, TExtension>)
Asynchronously retrieves a page of comments as specified by the provided criteria. The comments are filtered by the type of their associated data.
Declaration
Task<ResultPage<Composite<Comment, TExtension>>> GetAsync<TExtension>(CompositeCriteria<CommentFilter, TExtension> criteria)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| CompositeCriteria<CommentFilter, TExtension> | criteria | Filters the result set of comments |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ResultPage<Composite<Comment, TExtension>>> | Page of composite comments filtered according to the specified criteria |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type of data associated with the desired comments |
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. |
Remove(CommentId)
Deletes a comment and any associated extension data,
Declaration
void Remove(CommentId id)
Parameters
| Type | Name | Description |
|---|---|---|
| CommentId | id | ID of the item to be deleted |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the comment id passed in is null or empty. |
| 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(CommentId)
Asynchronously deletes a comment and any associated extension data,
Declaration
Task RemoveAsync(CommentId id)
Parameters
| Type | Name | Description |
|---|---|---|
| CommentId | id | ID of the item to be deleted |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | void |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the comment id passed in is null or empty. |
| 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(Comment)
Updates an existing comment.
Declaration
Comment Update(Comment comment)
Parameters
| Type | Name | Description |
|---|---|---|
| Comment | comment | Comment to be updated |
Returns
| Type | Description |
|---|---|
| Comment |
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. |
| InvalidCommentException | Thrown when the comment body being updated is empty. |
| CommentDoesNotExistException | Thrown when the identified comment 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. |
Update<TExtension>(Comment, TExtension)
Updates an existing comment and its supporting metadata to form a composite.
Declaration
Composite<Comment, TExtension> Update<TExtension>(Comment comment, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Comment | comment | Comment to be updated |
| TExtension | extension | Extended data related to the comment |
Returns
| Type | Description |
|---|---|
| Composite<Comment, TExtension> | A comment composed with the extended data |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type applied as an extension of the comment |
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. |
| InvalidCommentException | Thrown when the comment body being updated is empty. |
| CommentDoesNotExistException | Thrown when the identified comment 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(Comment)
Asynchronously updates an existing comment.
Declaration
Task<Comment> UpdateAsync(Comment comment)
Parameters
| Type | Name | Description |
|---|---|---|
| Comment | comment | Comment to be updated |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Comment> |
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. |
| InvalidCommentException | Thrown when the comment body being updated is empty. |
| CommentDoesNotExistException | Thrown when the identified comment 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>(Comment, TExtension)
Asynchronously updates an existing comment and its supporting metadata to form a composite.
Declaration
Task<Composite<Comment, TExtension>> UpdateAsync<TExtension>(Comment comment, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Comment | comment | Comment to be updated |
| TExtension | extension | Extended data related to the comment |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Comment, TExtension>> | A comment composed with the extended data |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type applied as an extension of the comment |
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. |
| InvalidCommentException | Thrown when the comment body being updated is empty. |
| CommentDoesNotExistException | Thrown when the identified comment 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. |