Example #1
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public virtual async Task <IEnumerable <TEntity> > GetAllAsync()
 {
     using (var connection = DbConnectionFactory.CreateConnection())
     {
         connection.Open();
         var sql = SqlSelectGenerator.GetSelectAll();
         return(await connection.QueryAsync <TEntity>(sql, null));
     }
 }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public virtual IEnumerable <TEntity> GetAll()
        {
            var sql = SqlSelectGenerator.GetSelectAll();

            using (var connection = DbConnectionFactory.CreateConnection())
            {
                connection.Open();
                return(connection.Query <TEntity>(sql));
            }
        }