Plumtree EDK (Enterprise Web Development Kit) 5.4.0 |

# IDiscussionManager.QueryDiscussions Method

Returns an array of `IDiscussion` that contains discussions within the given project; the returned results will be sorted according to the given `IFilter`.

IDiscussion[] QueryDiscussions(
IProject project,
IDiscussionFilter discussionfilter
);

#### Parameters

project
  The project; cannot be `null`.
discussionfilter
  The filter specifying the sort fields and the sort order, and maximum number of rows to return; cannot be `null`.

#### Return Value

An array of `IDiscussion` that contains discussions within the given project.

#### Remarks

The following sample code shows how to query for discussions, maximum results to return = 10.

    IDiscussionFilter discussionFilter = discussionManager.CreateDiscussionFilter();

    //limit the return results to be 10; setting this to 0 will return all results
    discussionFilter.MaximumResults = 10;

    //disable security checking on the returned objects against the user who performs this query,
    //so that all objects will be returned
    discussionFilter.RestoreSecurity = false;

    //an array of IDiscussion are returned from queryDiscussions(); if no result is retrieved, a zero-length array will be returned
    IDiscussion[] retrievedDiscussions = discussionManager.QueryDiscussions(project, discussionFilter);

#### Exceptions

Exception Type | Condition
--- | ---
InvalidOperationException | The project has not yet been stored or has already been removed.
CollaborationException | The method call resulted in an error.
SoapException | There is a communication problem during the execution of the remote method call.

#### See Also

IDiscussionManager Interface | Plumtree.Remote.PRC.Collaboration.Discussion Namespace