December 2019
Intermediate to advanced
598 pages
12h 21m
English
Wouldn't it be great if we could get the questions and answers in a single database query and then map this data to the hierarchical structure we require in our data repository? Well, this is exactly what we can do with a feature called multi-mapping in Dapper. Let's look at how we can use this:
public IEnumerable<QuestionGetManyResponse> GetQuestionsWithAnswers(){ using (var connection = new SqlConnection(_connectionString)) { connection.Open(); return connection.Query<QuestionGetManyResponse>( "EXEC dbo.Question_GetMany_WithAnswers"); }}
This is a good start but the Question_GetMany_WithAnswers ...
Read now
Unlock full access