Esempio n. 1
0
 /// <summary>
 /// QueryHintScope allows a developer to specify a SQL Server Query Hint to apply to all queries executed within the scope.
 /// NOTE: Make sure to use a USING { } pattern to prevent the query hint from getting added to other queries that fire off later
 /// </summary>
 /// <example>
 /// using ( new QueryHintScope( rockContext, QueryHintType.RECOMPILE ) )
 /// {
 ///     gTransactions.SetLinqDataSource( qry.AsNoTracking() );
 /// }
 /// </example>
 /// <param name="context">The context.</param>
 /// <param name="hintType">The hint.</param>
 public QueryHintScope(Rock.Data.DbContext context, QueryHintType hintType)
     : this(context, hintType.ConvertToString().Replace("_", " "))
 {
     // intentionally blank
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="QueryHintDbCommandInterceptor"/> class.
 /// </summary>
 /// <param name="dbContext">The database context.</param>
 /// <param name="hintType">Type of the hint.</param>
 public QueryHintDbCommandInterceptor(Rock.Data.DbContext dbContext, QueryHintType hintType)
     : this(dbContext, hintType.ConvertToString().Replace("_", " "))
 {
     // intentionally blank
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="QueryHintDbCommandInterceptor"/> class.
 /// </summary>
 /// <param name="dbContext">The database context.</param>
 /// <param name="hintType">Type of the hint.</param>
 public QueryHintDbCommandInterceptor( Rock.Data.DbContext dbContext, QueryHintType hintType )
     : this(dbContext, hintType.ConvertToString().Replace( "_", " " ))
 {
     // intentionally blank
 }
 protected QueryHint(QueryHintType type, string tableName)
 {
     this.Type      = type;
     this.TableName = tableName;
 }