public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args) { var criteria = ExpressionHelper.CriteriaDictionaryToExpression(table.GetQualifiedName(), MethodNameParser.ParseFromBinder(binder, args)); var data = dataStrategy.Find(table.GetQualifiedName(), criteria); return(CreateSimpleResultSet(table, dataStrategy, data)); }
public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args) { var criteriaExpression = ExpressionHelper.CriteriaDictionaryToExpression(table.GetQualifiedName(), MethodNameParser.ParseFromBinder(binder, args)); var data = dataStrategy.Find(table.GetQualifiedName(), criteriaExpression).FirstOrDefault(); return(data != null ? new SimpleRecord(data, table.GetQualifiedName(), dataStrategy) : null); }
public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args) { var criteria = ExpressionHelper.CriteriaDictionaryToExpression(table.GetQualifiedName(), MethodNameParser.ParseFromBinder(binder, args)); var data = dataStrategy.Find(table.GetQualifiedName(), criteria); return new SimpleResultSet(data != null ? data.Select(dict => new SimpleRecord(dict, table.GetQualifiedName(), dataStrategy)) : Enumerable.Empty<SimpleRecord>()); }
public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args) { var criteria = ExpressionHelper.CriteriaDictionaryToExpression(table.GetQualifiedName(), MethodNameParser.ParseFromBinder(binder, args)); var data = dataStrategy.Find(table.GetQualifiedName(), criteria); return(new SimpleResultSet(data != null ? data.Where(dict => dict != null).Select(dict => new SimpleRecord(dict, table.GetQualifiedName(), dataStrategy)) : Enumerable.Empty <SimpleRecord>())); }
/// <summary> /// Executes the command. /// </summary> /// <param name="dataStrategy">The database (or transaction)</param> /// <param name="table"></param> /// <param name="binder">The binder from the <see cref="DynamicTable"/> method invocation.</param> /// <param name="args">The arguments from the <see cref="DynamicTable"/> method invocation.</param> /// <returns></returns> public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args) { if (args.Length == 1 && args[0] is SimpleExpression) { var data = dataStrategy.Find(table.GetQualifiedName(), (SimpleExpression)args[0]).FirstOrDefault(); return(data != null ? new SimpleRecord(data, table.GetQualifiedName(), dataStrategy) : null); } return(null); }
/// <summary> /// Executes the command. /// </summary> /// <param name="dataStrategy">The database (or transaction)</param> /// <param name="table"></param> /// <param name="binder">The binder from the <see cref="DynamicTable"/> method invocation.</param> /// <param name="args">The arguments from the <see cref="DynamicTable"/> method invocation.</param> /// <returns></returns> public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args) { if (args.Length == 1 && args[0] is SimpleExpression) { var data = dataStrategy.Find(table.GetQualifiedName(), (SimpleExpression)args[0]).FirstOrDefault(); return data != null ? new SimpleRecord(data, table.GetQualifiedName(), dataStrategy) : null; } return null; }
/// <summary> /// Executes the command. /// </summary> /// <param name="dataStrategy">The database or transaction</param> /// <param name="table"></param> /// <param name="binder">The binder from the <see cref="DynamicTable"/> method invocation.</param> /// <param name="args">The arguments from the <see cref="DynamicTable"/> method invocation.</param> /// <returns></returns> public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args) { if (args.Length == 1 && args[0] is SimpleExpression) { var data = dataStrategy.Find(table.GetQualifiedName(), (SimpleExpression)args[0]); return new SimpleResultSet(data != null ? data.Select(dict => new SimpleRecord(dict, table.GetQualifiedName(), dataStrategy)) : Enumerable.Empty<SimpleRecord>()); } return null; }
/// <summary> /// Executes the command. /// </summary> /// <param name="dataStrategy">The database or transaction</param> /// <param name="table"></param> /// <param name="binder">The binder from the <see cref="DynamicTable"/> method invocation.</param> /// <param name="args">The arguments from the <see cref="DynamicTable"/> method invocation.</param> /// <returns></returns> public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args) { if (args.Length == 1 && args[0] is SimpleExpression) { var data = dataStrategy.Find(table.GetQualifiedName(), (SimpleExpression)args[0]); return(new SimpleResultSet(data != null ? data.Select(dict => new SimpleRecord(dict, table.GetQualifiedName(), dataStrategy)) : Enumerable.Empty <SimpleRecord>())); } return(null); }
/// <summary> /// Executes the command. /// </summary> /// <param name="database">The database.</param> /// <param name="table"></param> /// <param name="binder">The binder from the <see cref="DynamicTable"/> method invocation.</param> /// <param name="args">The arguments from the <see cref="DynamicTable"/> method invocation.</param> /// <returns></returns> public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args) { return(new SimpleResultSet(dataStrategy.Find(table.GetQualifiedName(), null) .Select(dict => new SimpleRecord(dict, table.GetQualifiedName(), dataStrategy)))); }
public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args) { var criteria = ExpressionHelper.CriteriaDictionaryToExpression(table.GetQualifiedName(), MethodNameParser.ParseFromBinder(binder, args)); var data = dataStrategy.Find(table.GetQualifiedName(), criteria); return CreateSimpleResultSet(table, dataStrategy, data); }
/// <summary> /// Executes the command. /// </summary> /// <param name="database">The database.</param> /// <param name="table"></param> /// <param name="binder">The binder from the <see cref="DynamicTable"/> method invocation.</param> /// <param name="args">The arguments from the <see cref="DynamicTable"/> method invocation.</param> /// <returns></returns> public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args) { return new SimpleResultSet(dataStrategy.Find(table.GetQualifiedName(), null) .Select(dict => new SimpleRecord(dict, table.GetQualifiedName(), dataStrategy))); }