Example #1
0
        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));
        }
Example #2
0
        public static string GetTableHintString(TableHint tableHints)
        {
            IEnumerable <TableHint> hintList = SqlBuilderHelper.GetTableHintList(tableHints);

            return(string.Join(
                       TSqlSyntax.FieldsDelimeter,
                       hintList.Select(s => PrepareTableHintName(s))
                       ));
        }
Example #3
0
 private void ProcessHint(ITableHints hintable)
 {
     if (Tokenizer.IsNextToken(_tableHints))
     {
         var hint = new TableHint {
             Hint = Tokenizer.Current.Value
         };
         hintable.TableHints.Add(hint);
         Tokenizer.ReadNextToken();
     }
 }
Example #4
0
        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);
        }
Example #6
0
 public static string PrepareTableHintName(TableHint tableHint)
 {
     return(tableHint.ToString().ToUpper());
 }
Example #7
0
 private WTableHint ParseTableHint(TableHint hint)
 {
     return new WTableHint
     {
         FirstTokenIndex = hint.FirstTokenIndex,
         LastTokenIndex = hint.LastTokenIndex,
         HintKind = hint.HintKind
     };
 }
Example #8
0
 public override void Visit(TableHint node) { this.action(node); }
 public override void ExplicitVisit(TableHint fragment)
 {
     _fragments.Add(fragment);
 }
Example #10
0
 public static bool TryLookUp(string lookup, out TableHint hint)
 {
     return(_keywords.TryGetValue(lookup.ToUpperInvariant(), out hint));
 }
Example #11
0
 public SelectFollowingBuilder <T> Select <T>(TableHint hints, params Field[] fields)
 {
     return(Select <T>(hints, (IEnumerable <Field>)fields));
 }
Example #12
0
 public SelectFollowingBuilder <T> Select <T>(TableHint hints, params Expression <Func <T, object> >[] fieldSelectors)
 {
     return(Select <T>(hints, (IEnumerable <Expression <Func <T, object> > >)fieldSelectors));
 }
Example #13
0
 public SelectFollowingBuilder <T> Select <T>(TableHint hints)
 {
     return(Select <T>(hints, Enumerable.Empty <Field>()));
 }
Example #14
0
 public override void ExplicitVisit(TableHint node)
 {
     this.Hints.Add(node);
 }