コード例 #1
0
        public TEntity Get(Expression <Func <TEntity, bool> > filter = null)
        {
            var dd = ExpressionExtensions.ToMSSqlString(filter);
            var k  = filter;

            throw new NotImplementedException();
        }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="filter">this filter works just only AND , OR operators</param>
 /// <returns></returns>
 public IEnumerable <T> GetAll(Expression filter = null)
 {
     using (var connection = CreateConnection())
     {
         return((filter == null) ?
                connection.Query <T>($"SELECT * FROM {_tableName}") :
                connection.Query <T>($"SELECT * FROM {_tableName} where {ExpressionExtensions.ToMSSqlString(filter)}"));
     }
 }
コード例 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="filter">this filter works just only AND , OR operators</param>
 /// <returns></returns>
 public async Task <IEnumerable <T> > GetAllAsync(Expression filter = null)
 {
     using (var connection = CreateConnection())
     {
         return(filter == null?
                await connection.QueryAsync <T>($"SELECT * FROM {_tableName}"):
                await connection.QueryAsync <T>($"SELECT * FROM {_tableName} where {ExpressionExtensions.ToMSSqlString(filter)}"));
     }
 }