AI OnAI Off
We solved it. And here is the solution:
Added the following (see the rest above):
answerQuery.AssignedQuestion.Expert.ID.Includes = new IntegerInCriterion();
answerQuery.AssignedQuestion.Expert.ID.Includes.Values.Add(expertid);
foreach (int id in experts)
{
answerQuery.AssignedQuestion.Expert.ID.Includes.Values.Add(id);
}
Hi,
We have a query that gives us answered question by expert. This is the function:
public static AssignedQuestionCollection GetAnsweredQuestionsByExpert(int expertId, int pageSize, int page, out int totalItems, SortingDirection sortingDirection)
{
AnswerQuery answerQuery = new AnswerQuery();
answerQuery.AssignedQuestion = new AssignedQuestionCriterion();
answerQuery.AssignedQuestion.Expert = new ExpertCriterion();
answerQuery.AssignedQuestion.Expert.ID = new IntegerCriterion();
answerQuery.AssignedQuestion.Expert.ID.Value = expertId;
answerQuery.Created = new DateTimeCriterion();
answerQuery.OrderBy.Add(new CriterionSortOrder(answerQuery.Created, sortingDirection));
QueryHandler.RemoveQueryResultCache(answerQuery);
AnswerCollection answers = QueryHandler.GetQueryResult<Answer, AnswerCollection>(answerQuery, page, pageSize, out totalItems);
AssignedQuestionCollection assignedQuestionCollection = new AssignedQuestionCollection();
foreach (var answer in answers)
{
assignedQuestionCollection.Add(answer.AssignedQuestion);
}
return assignedQuestionCollection;
}
We wish to rebuild this query to handle many expert id's. Any ideas how to use this function (or other solutions) to get many many experts answered question in a AssignedQuestionCollection list?
Regards,
Magnus