Ejemplo n.º 1
0
        public static IQuerySelection Field <T>(Expression <Func <T, object> > prop, String alias)
        {
            var entityType = typeof(T);
            var fieldName  = ReflectionUtils.GetPropertyNameFromExpression(prop);

            return(Expression(SelectExpr.Build().Field(entityType, fieldName, alias)));
        }
Ejemplo n.º 2
0
        private static IQuerySelection Expression(SelectExpr expr)
        {
            var expressionSelection =
                (AbstractExpressionSelection)_factory.CreateSelection(QuerySelectionExpressionType.Expression);

            expressionSelection.Expr = expr;
            return(expressionSelection);
        }
Ejemplo n.º 3
0
 public override void AcceptChildren(WSqlFragmentVisitor visitor)
 {
     if (SelectExpr != null)
     {
         SelectExpr.Accept(visitor);
     }
     base.AcceptChildren(visitor);
 }
Ejemplo n.º 4
0
        public static IQuerySelection Query(ISelectionQuery query, String alias)
        {
            var expressionSelection =
                (AbstractExpressionSelection)_factory.CreateSelection(QuerySelectionExpressionType.Expression);

            expressionSelection.Expr = SelectExpr.Build().Query(query, alias);
            return(expressionSelection);
        }
Ejemplo n.º 5
0
        public override void WriteToStream(IndentStream stream)
        {
            stream.Write("CURSOR");

            if (Options != null && Options.Count > 0)
            {
                stream.Write(" ");
                var code = string.Join(" ", Options);
                stream.Write(code);
            }

            stream.Write(" FOR ");
            SelectExpr.WriteToStream(stream);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>A hash code for the current Object.</returns>
 public override int GetHashCode()
 {
     return(SelectExpr.GetHashCode());
 }
Ejemplo n.º 7
0
 public static IQuerySelection Sum <T>(Expression <Func <T, object> > prop, String alias)
 {
     return(Expression(SelectExpr.Build().Field(prop, alias).Sum()));
 }
Ejemplo n.º 8
0
 public static IQuerySelection Sum(Type entityType, String field, String alias)
 {
     return(Expression(SelectExpr.Build().Field(entityType, field, alias).Sum()));
 }
Ejemplo n.º 9
0
 public static IQuerySelection Field(String field, String alias)
 {
     return(Expression(SelectExpr.Build().Field(field, alias)));
 }
Ejemplo n.º 10
0
 public static IQuerySelection CustFunction <T>(String sqlFunction, Expression <Func <T, object> > prop, String alias)
 {
     return(Expression(SelectExpr.Build().Field(prop, alias).CustFunc(sqlFunction)));
 }
Ejemplo n.º 11
0
 public static IQuerySelection CustFunction(String sqlFunction, Type entityType, String field, String alias)
 {
     return(Expression(SelectExpr.Build().Field(entityType, field, alias).CustFunc(sqlFunction)));
 }
Ejemplo n.º 12
0
        internal override string ToString(string indent)
        {
            var line = SelectExpr.ToString(indent);

            return(ColumnName != null?string.Format(CultureInfo.CurrentCulture, "{0} AS {1}", line, ColumnName) : line);
        }
Ejemplo n.º 13
0
 internal override bool OneLine()
 {
     return(SelectExpr.OneLine());
 }