Creating a Repository Method to Get Questions by a Search

Learn repository pattern to create a method that returns a list of filtered questions.

Implementation of repository method for question search

Let’s implement the GetQuestionsBySearch method, which is similar to the GetQuestions method, but this time, the method and stored procedure have a parameter. Let’s carry out the following steps:

  1. Start by creating and opening the connection in the same way as we did when we implemented the last method:

Get hands-on with 1200+ tech skills courses.