Class HttpCommentRepository

Inheritance
System.Object
HttpCommentRepository
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.Comments.Rest
Assembly: EPiServer.Social.Comments.Rest.dll
Version: 1.5.4
Syntax
public class HttpCommentRepository : ICommentRepository

Constructors

HttpCommentRepository(IHttpClientFactory, ICommentRequestFactory)

Declaration
public HttpCommentRepository(IHttpClientFactory httpClientFactory, ICommentRequestFactory requestFactory)
Parameters
Type Name Description
IHttpClientFactory httpClientFactory
ICommentRequestFactory requestFactory

Methods

Add(Comment)

Adds a new comment to the underlying data store.

Declaration
public Comment Add(Comment comment)
Parameters
Type Name Description
Comment comment

The partially populated comment to be added

Returns
Type Description
Comment

The fully populated comment that was added.

Add<TExtension>(Comment, TExtension)

Adds a new composite comment to the underlying data store.

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

The partially populated comment to be added

TExtension extension
Returns
Type Description
Composite<Comment, TExtension>

The fully populated comment that was added.

Type Parameters
Name Description
TExtension

Type of extension data for the comment being added.

AddAsync(Comment)

Asynchronously adds a new comment to the underlying data store.

Declaration
public Task<Comment> AddAsync(Comment comment)
Parameters
Type Name Description
Comment comment

The partially populated comment to be added

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

The fully populated comment that was added.

Exceptions
Type Condition
SocialCommunicationException

Thrown when the cloud service cannot be reached.

AddAsync<TExtension>(Comment, TExtension)

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

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

The partially populated comment to be added

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

The fully populated comment that was added.

Type Parameters
Name Description
TExtension

Type of extension data for the comment being added.

Exceptions
Type Condition
SocialCommunicationException

Thrown when the cloud service cannot be reached.

Get(CommentId)

Finds a comment by its identifier.

Declaration
public Comment Get(CommentId id)
Parameters
Type Name Description
CommentId id

Id of comment to retrieve.

Returns
Type Description
Comment

The identified comment

Exceptions
Type Condition
CommentDoesNotExistException

Thrown when the identified comment does not exist.

Get(Criteria<CommentFilter>)

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

Declaration
public ResultPage<Comment> Get(Criteria<CommentFilter> criteria)
Parameters
Type Name Description
Criteria<CommentFilter> criteria

Criteria by which to filter comment items

Returns
Type Description
ResultPage<Comment>

Page of comment items

Get<TExtension>(CommentId)

Finds a comment by its identifier.

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

Id of comment to retrieve.

Returns
Type Description
Composite<Comment, TExtension>

The identified comment

Type Parameters
Name Description
TExtension

Type of extension data to retrieve.

Exceptions
Type Condition
CommentDoesNotExistException

Thrown when the identified comment does not exist.

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

Retrieves a page of comment 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<Comment, TExtension>> Get<TExtension>(CompositeCriteria<CommentFilter, TExtension> criteria)
    where TExtension : class
Parameters
Type Name Description
CompositeCriteria<CommentFilter, TExtension> criteria

Criteria by which to filter comment items

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

Page of comment items composed with their extension data

Type Parameters
Name Description
TExtension

Type of extension data associated with the items to be retrieved

GetAsync(CommentId)

Asynchronously finds a comment by its identifier.

Declaration
public Task<Comment> GetAsync(CommentId id)
Parameters
Type Name Description
CommentId id

Id of comment to retrieve.

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

The identified comment

Exceptions
Type Condition
CommentDoesNotExistException

Thrown when the identified comment does not exist.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

GetAsync(Criteria<CommentFilter>)

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

Declaration
public Task<ResultPage<Comment>> GetAsync(Criteria<CommentFilter> criteria)
Parameters
Type Name Description
Criteria<CommentFilter> criteria

Criteria by which to filter comment items

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

Page of comment items

Exceptions
Type Condition
SocialCommunicationException

Thrown when the cloud service cannot be reached.

GetAsync<TExtension>(CommentId)

Asynchronously finds a comment by its identifier.

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

Id of comment to retrieve.

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

The identified comment

Type Parameters
Name Description
TExtension

Type of extension data to retrieve.

Exceptions
Type Condition
CommentDoesNotExistException

Thrown when the identified comment does not exist.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

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

Asynchronously retrieves a page of comment 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<Comment, TExtension>>> GetAsync<TExtension>(CompositeCriteria<CommentFilter, TExtension> criteria)
    where TExtension : class
Parameters
Type Name Description
CompositeCriteria<CommentFilter, TExtension> criteria

Criteria by which to filter comment items

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

Page of comment 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.

Remove(CommentId)

Deletes a comment as identified by the specified ID.

Declaration
public 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.

CommentDoesNotExistException

Thrown when the identified comment does not exist.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

RemoveAsync(CommentId)

Asynchronously deletes a comment as identified by the specified ID.

Declaration
public Task RemoveAsync(CommentId id)
Parameters
Type Name Description
CommentId id

ID of the item to be deleted

Returns
Type Description
System.Threading.Tasks.Task

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.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

Update(Comment)

Updates a comment by its identifier.

Declaration
public Comment Update(Comment comment)
Parameters
Type Name Description
Comment comment

updated version of the comment.

Returns
Type Description
Comment

The identified comment

Exceptions
Type Condition
CommentDoesNotExistException

Thrown when the identified comment does not exist.

Update<TExtension>(Comment, TExtension)

Updates a comment by its identifier.

Declaration
public Composite<Comment, TExtension> Update<TExtension>(Comment comment, TExtension extension)
    where TExtension : class
Parameters
Type Name Description
Comment comment

updated version of the comment.

TExtension extension

updated version of the extension data.

Returns
Type Description
Composite<Comment, TExtension>

The identified comment

Type Parameters
Name Description
TExtension

Type of extension data for the comment being updated.

Exceptions
Type Condition
CommentDoesNotExistException

Thrown when the identified comment does not exist.

UpdateAsync(Comment)

Asynchronously updates a comment by its identifier.

Declaration
public Task<Comment> UpdateAsync(Comment comment)
Parameters
Type Name Description
Comment comment

updated version of the comment.

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

The identified comment

Exceptions
Type Condition
CommentDoesNotExistException

Thrown when the identified comment does not exist.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

UpdateAsync<TExtension>(Comment, TExtension)

Asychronously updates a comment by its identifier.

Declaration
public Task<Composite<Comment, TExtension>> UpdateAsync<TExtension>(Comment comment, TExtension extension)
    where TExtension : class
Parameters
Type Name Description
Comment comment

updated version of the comment.

TExtension extension

updated version of the extension data.

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

The identified comment

Type Parameters
Name Description
TExtension

Type of extension data for the comment being updated.

Exceptions
Type Condition
CommentDoesNotExistException

Thrown when the identified comment does not exist.

SocialCommunicationException

Thrown when the cloud service cannot be reached.

Implements

arrow_upward