Esempio n. 1
0
 public void Select(Tables.View view, Action <IDictionary <int, string>, DbDataReader> readAction = null, IEnumerable <Conditions.Condition> conditions = null, IDictionary <string, bool> orderFields = null, int?limit = null, int?offset = null)
 {
     if (view != null)
     {
         DoCommand((command) => {
             command = CreateSelectCommand(command, view, conditions, orderFields, limit, offset);
         }, (command) =>
         {
             var reader = command.ExecuteReader();
             if (reader.HasRows)
             {
                 bool isNext = reader.Read();
                 while (isNext)
                 {
                     readAction?.Invoke(view.GetSelectFields(), reader);
                     isNext = reader.Read();
                 }
             }
         });
     }
 }
Esempio n. 2
0
 public long SelectCount(Tables.View view, IEnumerable <Conditions.Condition> conditions = null)
 {
     return(SelectCount(view.Tables.Select(x => x.Name), view.Join, conditions));
 }
Esempio n. 3
0
 public long SelectCount(Tables.View view, LambdaExpression expr)
 {
     return(SelectCount(view, (expr != null) ? DataBase.ParseConditionExpression(expr) : null));
 }
Esempio n. 4
0
 public void Select <T, P>(Tables.View view, Action <IDictionary <int, string>, DbDataReader> readAction, LambdaExpression expr, IDictionary <Expression <Func <T, P> >, bool> orderFields = null, int?limit = null, int?offset = null)
 {
     Select(view, readAction, (expr != null) ? DataBase.ParseConditionExpression(expr) : null, orderFields?.ToDictionary(x => DataBase.GetViewField(x.Key).GetSelectName(true), x => x.Value), limit, offset);
 }
Esempio n. 5
0
 public void Select(Tables.View view, Action <IDictionary <int, string>, DbDataReader> readAction, LambdaExpression expr, IDictionary <string, bool> orderFields = null, int?limit = null, int?offset = null)
 {
     Select(view, readAction, (expr != null) ? DataBase.ParseConditionExpression(expr) : null, orderFields, limit, offset);
 }