Let's implement the GetUnansweredQuestions method, which is very similar to the GetQuestions method:
public IEnumerable<QuestionGetManyResponse> GetUnansweredQuestions()
{
using (var connection = new SqlConnection(_connectionString))
{
connection.Open();
return connection.Query<QuestionGetManyResponse>(
"EXEC dbo.Question_GetUnanswered"
);
}
}
So, we open the connection, execute the Question_GetUnanswered stored procedure, and return the results in the QuestionGetManyResponse class we have already created.