Exemplo n.º 1
0
 public IList <T> Select <T>(string sql, IList <Parameter> parameters = null, int timeout = 15) where T : class, new()
 {
     using (IOrm orm = this.orm)
     {
         return(orm.Select <T>(new SqlCommand(sql, parameters, timeout), CustomMapper.Resolve <T>()).ToList());
     }
 }
Exemplo n.º 2
0
 public IList <T> Select <T>(Expression <Func <T, bool> > expression, int timeout = 15) where T : class, new()
 {
     using (IOrm orm = this.orm)
     {
         SqlCommand result = DynamicQuery.GetDynamicQuery(typeof(T).Name.ToLowerInvariant().Pluralize(), expression);
         return(orm.Select <T>(new SqlCommand(result.Statement, result.Parameters, timeout)).ToList());
     }
 }