Try to answer the following questions to check the knowledge that you have gained in this chapter:
- We have the following code in a data repository that uses Dapper's multi result feature to return a single order with the many related detail lines in a single database call:
using (var connection = new SqlConnection(_connectionString))
{
connection.Open();
using (GridReader results = connection.QueryMultiple(
@"EXEC dbo.Order_GetHeader @OrderId = @OrderId;
EXEC dbo.OrderDetails_Get_ByOrderId @OrderId = @OrderId",
new { OrderId = orderId }))
{
// TODO - Read the order and details from the query result
return order;
}
}
What are the missing statements that will read the order and its details from the results putting the details in the order model? The order model is of the OrderGetSingleResponse type and contains a Details property of...