DynamicQueryEngine/SpannerSpecificCreator.cs
/// <summary>
/// Produces the from clause directive fragments from the specified fromClauseElementDirectives.
/// </summary>
/// <param name="fromClauseElementDirectives">From clause element directives to use to produce the fragments requested. If null, only global setting driven hints are produced.</param>
/// <param name="tableHintFragment">The table hint fragment produced. Can be empty string.</param>
/// <param name="joinHintFragment">The join hint fragment. Can be empty string.</param>
/// <param name="joinHintParameters">The join hint parameters (if any) created for the join hint Fragment. If no parameters are created, this
/// parameter is null</param>
Produces the from clause directive fragments from the specified fromClauseElementDirectives.
Produces the from clause directive fragments from the specified fromClauseElementDirectives .
public override void ProduceFromClauseDirectiveFragments(IEnumerable<FromClauseElementDirective> fromClauseElementDirectives, out string tableHintFragment,
                                                                 out string joinHintFragment, out List<DbParameter> joinHintParameters)
        {
			joinHintParameters = null;
            joinHintFragment = string.Empty;
            tableHintFragment = string.Empty;
			if(fromClauseElementDirectives != null && fromClauseElementDirectives.Any())
			{
				var tableHintFragments = new QueryFragments(", ") { Prefix = "@{", Suffix = "}" };
				var joinHintFragments = new QueryFragments(", ") { Prefix = "@{", Suffix = "}" };
				foreach(var fcd in fromClauseElementDirectives)
				{
					var fragment = fcd.ToQueryText(this, out var _);
					switch(fcd.DirectiveType)
					{
						case FromClauseElementDirectiveType.TableViewHint:
							if(fragment.StartsWith("FORCE_INDEX", StringComparison.InvariantCultureIgnoreCase))
							{
								tableHintFragments.AddFragment(fragment);
							}
							else
							{
								joinHintFragments.AddFragment(fragment);
							}
							break;
					}
				}
				if(tableHintFragments.Count > 0)
				{
					tableHintFragment = tableHintFragments.ToString();
				}
				if(joinHintFragments.Count > 0)
				{
					joinHintFragment = joinHintFragments.ToString();
				}
			}
        }
public override void ProduceFromClauseDirectiveFragments ( IEnumerable < FromClauseElementDirective > fromClauseElementDirectives , out string tableHintFragment , out string joinHintFragment , out List < DbParameter > joinHintParameters ) { joinHintParameters = null ; joinHintFragment = string . Empty ; tableHintFragment = string . Empty ; if ( fromClauseElementDirectives != null && fromClauseElementDirectives . Any ( ) ) { var tableHintFragments = new QueryFragments ( " " ) { Prefix = " " , Suffix = " " } ; var joinHintFragments = new QueryFragments ( " " ) { Prefix = " " , Suffix = " " } ; foreach ( var fcd in fromClauseElementDirectives ) { var fragment = fcd . ToQueryText ( this , out var _ ) ; switch ( fcd . DirectiveType ) { case FromClauseElementDirectiveType . TableViewHint : if ( fragment . StartsWith ( " " , StringComparison . InvariantCultureIgnoreCase ) ) { tableHintFragments . AddFragment ( fragment ) ; } else { joinHintFragments . AddFragment ( fragment ) ; } break ; } } if ( tableHintFragments . Count > 0 ) { tableHintFragment = tableHintFragments . ToString ( ) ; } if ( joinHintFragments . Count > 0 ) { joinHintFragment = joinHintFragments . ToString ( ) ; } } }
Produces the from clause directive fragments from the specified fromClauseElementDirectives.
Produces the from clause directive fragments from the specified fromClauseElementDirectives .
// as there's just 1 temporal predicate possible, last one wins.  // add the force_index hint to the table hints, the rest to the join hints. 
fromClauseElementDirectives
IEnumerable<FromClauseElementDirective>
From clause element directives to use to produce the fragments requested. If null, only global setting driven hints are produced.
From clause element directives to use to produce the fragments requested . If null only global setting driven hints are produced .
string
out
List<DbParameter>
out
tableHintFragment
The table hint fragment produced. Can be empty string.
The table hint fragment produced . Can be empty string .
joinHintFragment
The join hint fragment. Can be empty string.
The join hint fragment . Can be empty string .
joinHintParameters
The join hint parameters (if any) created for the join hint Fragment. If no parameters are created, this
parameter is null
The join hint parameters ( if any ) created for the join hint Fragment . If no parameters are created this parameter is null