public T ExecuteScalar <T>(QueryModel queryModel) { SqliteQueryModelVisitor visitor = new SqliteQueryModelVisitor(_context); visitor.VisitQueryModel(queryModel); var result = _connection.ExecuteScalar(visitor.GetSql(), visitor.Parameters.ToDictionary()); //, _transaction ); return((T)Convert.ChangeType(result, typeof(T))); }
public IEnumerable <T> ExecuteCollection <T>(QueryModel queryModel) { SqliteQueryModelVisitor visitor = new SqliteQueryModelVisitor(_context); visitor.VisitQueryModel(queryModel); // TJT: remove after testing var sql = visitor.GetSql(); var queryResult = _connection.ExecuteReader(sql, visitor.Parameters, _transaction); return(_materializer.Materialize <T>(queryResult)); }