December 2019
Intermediate to advanced
598 pages
12h 21m
English
The last method to implement in this section is GetAnswer:
public AnswerGetResponse GetAnswer(int answerId){ using (var connection = new SqlConnection(_connectionString)) { connection.Open(); return connection.QueryFirstOrDefault<AnswerGetResponse>( @"EXEC dbo.Answer_Get_ByAnswerId @AnswerId = @AnswerId", new { AnswerId = answerId } ); }}
There is nothing new here—the implementation follows the same pattern as the previous methods.
We have now implemented all of the methods in the data repository for reading data. In the next section, we'll turn our attention to writing data.
Read now
Unlock full access