Exemplo n.º 1
0
        internal static Chainer CreateQueryFromSubject(DbNode currentNode)
        {
            if (currentNode is IFunction)
            {
                var arguments = ((IFunction)currentNode).Arguments;

                DbMapping.PrepareFunctionArguments(arguments, currentNode);

                return(currentNode.GetDesigner()
                       .From(currentNode.Map.Name.PassUdf(
                                 ((IFunction)currentNode).Arguments), currentNode)
                       .As(currentNode.Index));
            }
            // table
            else
            {
                if (currentNode.IsSynonym)
                {
                    if (currentNode.SynonymQuery is IOpenView)
                    {
                        return(currentNode.GetDesigner().From((IOpenView)currentNode.SynonymQuery, currentNode)
                               .As(currentNode.Index));
                    }
                    // View
                    else
                    {
                        return(currentNode.GetDesigner().From((View)currentNode.SynonymQuery, currentNode)
                               .As(currentNode.Index));
                    }
                }
                else
                {
                    if (currentNode.Row != null)
                    {
                        var row = currentNode.Row;
                        return(currentNode.GetDesigner()
                               .From(currentNode.Map.Name, currentNode).As(currentNode.Index)
                               .Where(DbMapping.GetNodeMap(row.NodeID)
                                      .BuildRKExpression(row.GetOriginalRKValues(), currentNode.Index)));
                    }
                    else
                    {
                        return(currentNode.GetDesigner()
                               .From(currentNode.Map.Name, currentNode)
                               .As(currentNode.Index));
                    }
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Specifies a list of arguments which are to be passed to the scalar function. The parameter values have to be passed in the order of parameters as declared in the scalar function.
 /// </summary>
 /// <param name="arguments">Are the arguments to pass.</param>
 protected Udf Pass(params FunctionArgument[] arguments)
 {
     DbMapping.PrepareFunctionArguments(arguments, this);
     return(new Udf(Map.Name, arguments));
 }
Exemplo n.º 3
0
 Udf IFunction.GetUdf()
 {
     DbMapping.PrepareFunctionArguments(_arguments, this);
     return(new Udf(Map.Name, _arguments));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Specifies a list of arguments which are to be passed to the table-valued function. The parameter values have to be passed in the order of parameters as declared in the table-valued function.
 /// </summary>
 /// <param name="arguments">Are the arguments to pass.</param>
 protected DbTableFunc <TNode> Pass(params FunctionArgument[] arguments)
 {
     DbMapping.PrepareFunctionArguments(arguments, this);
     _arguments = arguments;
     return(this);
 }