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.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to 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