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))); }
private static IQuerySelection Expression(SelectExpr expr) { var expressionSelection = (AbstractExpressionSelection)_factory.CreateSelection(QuerySelectionExpressionType.Expression); expressionSelection.Expr = expr; return(expressionSelection); }
public override void AcceptChildren(WSqlFragmentVisitor visitor) { if (SelectExpr != null) { SelectExpr.Accept(visitor); } base.AcceptChildren(visitor); }
public static IQuerySelection Query(ISelectionQuery query, String alias) { var expressionSelection = (AbstractExpressionSelection)_factory.CreateSelection(QuerySelectionExpressionType.Expression); expressionSelection.Expr = SelectExpr.Build().Query(query, alias); return(expressionSelection); }
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); }
/// <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()); }
public static IQuerySelection Sum <T>(Expression <Func <T, object> > prop, String alias) { return(Expression(SelectExpr.Build().Field(prop, alias).Sum())); }
public static IQuerySelection Sum(Type entityType, String field, String alias) { return(Expression(SelectExpr.Build().Field(entityType, field, alias).Sum())); }
public static IQuerySelection Field(String field, String alias) { return(Expression(SelectExpr.Build().Field(field, alias))); }
public static IQuerySelection CustFunction <T>(String sqlFunction, Expression <Func <T, object> > prop, String alias) { return(Expression(SelectExpr.Build().Field(prop, alias).CustFunc(sqlFunction))); }
public static IQuerySelection CustFunction(String sqlFunction, Type entityType, String field, String alias) { return(Expression(SelectExpr.Build().Field(entityType, field, alias).CustFunc(sqlFunction))); }
internal override string ToString(string indent) { var line = SelectExpr.ToString(indent); return(ColumnName != null?string.Format(CultureInfo.CurrentCulture, "{0} AS {1}", line, ColumnName) : line); }
internal override bool OneLine() { return(SelectExpr.OneLine()); }