Work with threads

Create a thread

When creating a thread, you must perform the following:

  1. Get an instance of the Comment Service using the GetCommentsService method part of the SystemManager.
  2. Create an AuthorProxy.
    When creating comments, information is required about the author of the new comment, for example a name, email, and so on. Therefore, there is a  AuthorProxy class which implements the IAuthor interface.
  3. To create a thread, you need to create a ThreadProxy.
    The constructor requires as parameters a title, item type, group key, author, and culture.
  4. Create the thread using the CreateThread method as part of the comment service.
The following code creates a thread:

Query threads

Use any of the following options to retrieve threads:

  • Get a thread by threadKey:
  • Get all threads by specific criteria.
    You must use the GetThreads method part of the comments service:

Modify threads

You can update existing thread properties using the UpdateThread method. The sample below demonstrates how to change the IsClosed property of the thread:

Delete threads

You can delete a thread using the DeleteThread method:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?

Next article

Work with groups