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(); } } }); } }
public long SelectCount(Tables.View view, IEnumerable <Conditions.Condition> conditions = null) { return(SelectCount(view.Tables.Select(x => x.Name), view.Join, conditions)); }
public long SelectCount(Tables.View view, LambdaExpression expr) { return(SelectCount(view, (expr != null) ? DataBase.ParseConditionExpression(expr) : null)); }
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); }
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); }