Work with threads
Create a thread
When creating a thread, you must perform the following:
- Get an instance of the Comment Service using the GetCommentsService method part of the SystemManager.
- 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.
- To create a thread, you need to create a ThreadProxy.
The constructor requires as parameters a title, item type, group key, author, and culture.
- 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: