Interface ICommentRepository

The ICommentRepository 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.4
Syntax
public interface ICommentRepository

Methods

Add(Comment)

Add a new comment.

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

Comment to store.

Returns
Type Description
Comment

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 item to be added

TExtension extension

Extended data related to the comment item

Returns
Type Description
Composite<Comment, TExtension>

The comment item composed with the extended data

Type Parameters
Name Description
TExtension

Type applied as an extension of the comment item

AddAsync(Comment)

Asynchronously add a new comment.

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

Comment to store.

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

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 item to be added

TExtension extension

Extended data related to the comment item

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

The comment item composed with the extended data

Type Parameters
Name Description
TExtension

Type applied as an extension of the comment item

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

Get(Criteria<CommentFilter>)

Retrieves a collection of comments that are immediate children of a particular parent entity, identified with the Parent property of the criteria parameter.

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

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

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

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

GetAsync(Criteria<CommentFilter>)

Asynchronously retrieves a collection of comments that are immediate children of a particular parent entity, identified with the Parent property of the criteria parameter.

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

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

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

Remove(CommentId)

Removes an existing comment by its comment identifier.

Declaration
void Remove(CommentId id)
Parameters
Type Name Description
CommentId id

Identifier of the comment to remove.

RemoveAsync(CommentId)

Asynchronously removes an existing comment by its comment identifier.

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

Identifier of the comment to remove.

Returns
Type Description
System.Threading.Tasks.Task

Update(Comment)

Updates an existing comment.

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

Comment to store.

Returns
Type Description
Comment

Update<TExtension>(Comment, TExtension)

Updates a comment with 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 added

TExtension extension

Extended data related to the comment

Returns
Type Description
Composite<Comment, TExtension>

The comment composed with the extended data

Type Parameters
Name Description
TExtension

Type applied as an extension of the comment

UpdateAsync(Comment)

Asynchronously updates an existing comment.

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

Comment to store.

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

UpdateAsync<TExtension>(Comment, TExtension)

Asynchronously updates a comment with 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 added

TExtension extension

Extended data related to the comment

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

The comment composed with the extended data

Type Parameters
Name Description
TExtension

Type applied as an extension of the comment

arrow_upward