public SelectFollowingBuilder <T> Select <T>(TableHint hints, IEnumerable <Expression <Func <T, object> > > fieldSelectors) { IEnumerable <Field> fields = fieldSelectors.Select( f => new Field(typeof(T).Name, SqlBuilderHelper.GetMemberNameFromExpression(f)) ); return(Select <T>(hints, fields)); }
public static string GetTableHintString(TableHint tableHints) { IEnumerable <TableHint> hintList = SqlBuilderHelper.GetTableHintList(tableHints); return(string.Join( TSqlSyntax.FieldsDelimeter, hintList.Select(s => PrepareTableHintName(s)) )); }
private void ProcessHint(ITableHints hintable) { if (Tokenizer.IsNextToken(_tableHints)) { var hint = new TableHint { Hint = Tokenizer.Current.Value }; hintable.TableHints.Add(hint); Tokenizer.ReadNextToken(); } }
public static IEnumerable <TableHint> GetTableHintList(TableHint tableHints) { List <TableHint> hintsToAdd = new List <TableHint>(); foreach (TableHint hint in Enum.GetValues(typeof(TableHint))) { if (tableHints.HasFlag(hint)) { hintsToAdd.Add(hint); } } return(hintsToAdd); }
private string BuildTableQuery(Dictionary <string, string> tHints, string Query) { if (tHints.ContainsKey("Empty")) { Query = TableHint.BuildQuery(Query, tHints["Empty"]); } foreach (var item in tHints) { if (item.Key != "Empty") { Query = TableHint.BuildQuery(Query, item.Value, item.Key); } } return(Query); }
public static string PrepareTableHintName(TableHint tableHint) { return(tableHint.ToString().ToUpper()); }
private WTableHint ParseTableHint(TableHint hint) { return new WTableHint { FirstTokenIndex = hint.FirstTokenIndex, LastTokenIndex = hint.LastTokenIndex, HintKind = hint.HintKind }; }
public override void Visit(TableHint node) { this.action(node); }
public override void ExplicitVisit(TableHint fragment) { _fragments.Add(fragment); }
public static bool TryLookUp(string lookup, out TableHint hint) { return(_keywords.TryGetValue(lookup.ToUpperInvariant(), out hint)); }
public SelectFollowingBuilder <T> Select <T>(TableHint hints, params Field[] fields) { return(Select <T>(hints, (IEnumerable <Field>)fields)); }
public SelectFollowingBuilder <T> Select <T>(TableHint hints, params Expression <Func <T, object> >[] fieldSelectors) { return(Select <T>(hints, (IEnumerable <Expression <Func <T, object> > >)fieldSelectors)); }
public SelectFollowingBuilder <T> Select <T>(TableHint hints) { return(Select <T>(hints, Enumerable.Empty <Field>())); }
public override void ExplicitVisit(TableHint node) { this.Hints.Add(node); }