Example #1
0
        public List <Question> GetQuestions()
        {
            var questions = _dapperWrapper.Query <Question>("SELECT * FROM Question ORDER BY DatePosted DESC", null);

            return(questions.ToList());
        }
 public async Task <IEnumerable <T> > GetByQuery <Q, S, T>(string query, Func <Q, S, T> map, object param = null, string splitOn = "Id")
 {
     return(await _dapper.Query <Q, S, T>(_dbconnection, map, query, param, _openTransaction, true, null, null, splitOn).ConfigureAwait(false));
 }
Example #3
0
 /// <summary>
 ///     Never called directly, rather called via reflection.
 /// </summary>
 internal IEnumerable <T> Query <T>(IDbConnection dbConnection, ISqlEndpoint endpoint)
     where T : class, new()
 {
     // Pass the simple Id=1 anonymous object to support Dapper's hashing and caching of queries
     return(_dapperWrapper.Query <T>(dbConnection, CommandText, new { Id = 1 }));
 }