当前位置: 首页>>代码示例>>C#>>正文


C# IDbProfiler类代码示例

本文整理汇总了C#中IDbProfiler的典型用法代码示例。如果您正苦于以下问题:C# IDbProfiler类的具体用法?C# IDbProfiler怎么用?C# IDbProfiler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IDbProfiler类属于命名空间,在下文中一共展示了IDbProfiler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SimpleProfiledConnection

 /// <summary>
 /// Creates a simple profiled connection instance.
 /// </summary>
 /// <param name="connection">The database connection to wrap</param>
 /// <param name="profiler">The profiler to use</param>
 public SimpleProfiledConnection(IDbConnection connection, IDbProfiler profiler)
 {
     _connection = connection;
     if (profiler != null)
     {
         _profiler = profiler;
     }
 }
开发者ID:neocsr,项目名称:MiniProfiler,代码行数:13,代码来源:SimpleProfiledConnection.cs

示例2: ProfiledDbCommand

        public ProfiledDbCommand(DbCommand command, DbConnection connection, IDbProfiler profiler)
        {
            if (command == null) throw new ArgumentNullException("command");

            InternalCommand = command;
            _connection = connection;

            _profiler = profiler;
        }
开发者ID:yao-yi,项目名称:DNTProfiler,代码行数:9,代码来源:ProfiledDbCommand.cs

示例3: ProfiledDbDataReader

        /// <summary>
        /// Initialises a new instance of the <see cref="ProfiledDbDataReader"/> class.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="connection">The connection.</param>
        /// <param name="profiler">The profiler.</param>
        public ProfiledDbDataReader(DbDataReader reader, DbConnection connection, IDbProfiler profiler)
        {
            _reader = reader;

            if (profiler != null)
            {
                _profiler = profiler;
            }
        }
开发者ID:CurufinweU,项目名称:dotnet,代码行数:15,代码来源:ProfiledDbDataReader.cs

示例4: ProfiledDbDataAdapter

        /// <summary>
        /// Initialises a new instance of the <see cref="ProfiledDbDataAdapter"/> class.
        /// </summary>
        /// <param name="wrappedAdapter">The wrapped adapter.</param>
        /// <param name="profiler">The profiler.</param>
        public ProfiledDbDataAdapter(IDbDataAdapter wrappedAdapter, IDbProfiler profiler = null)
        {
            if (wrappedAdapter == null)
            {
                throw new ArgumentNullException("wrappedAdapter");
            }

            _adapter = wrappedAdapter;
            _profiler = profiler ?? MiniProfiler.Current;
        }
开发者ID:haroonxml,项目名称:dotnet,代码行数:15,代码来源:ProfiledDbDataAdapter.cs

示例5: ProfiledDbTransaction

 public ProfiledDbTransaction(DbTransaction transaction, ProfiledDbConnection connection, IDbProfiler profiler)
 {
     if (transaction == null) throw new ArgumentNullException("transaction");
     if (connection == null) throw new ArgumentNullException("connection");
     InnerTransaction = transaction;
     _connection = connection;
     _profiler = profiler;
     _connectionId = UniqueIdExtensions<DbConnection>.GetUniqueId(connection.InnerConnection).ToInt();
     _profiler.TransactionBegan(connection.InnerConnection, NHProfilerContextProvider.GetLoggedDbConnection(this, _connectionId));
 }
开发者ID:yao-yi,项目名称:DNTProfiler,代码行数:10,代码来源:ProfiledDbTransaction.cs

示例6: ProfiledDbDataReader

        public ProfiledDbDataReader(DbDataReader reader, DbConnection connection, IDbProfiler profiler)
        {
            this.reader = reader;
            db = connection;

            if (profiler != null)
            {
                this.profiler = profiler;
            }
        }
开发者ID:AVee,项目名称:ServiceStack,代码行数:10,代码来源:ProfiledDbDataReader.cs

示例7: ProfiledDbConnection

        public ProfiledDbConnection(IDbConnection connection, IDbProfiler profiler, bool autoDisposeConnection=true)
        {
    		var hasConn = connection as IHasDbConnection;
			if (hasConn != null) connection = hasConn.DbConnection;
    		var dbConn = connection as DbConnection;

			if (dbConn == null)
				throw new ArgumentException(connection.GetType().GetOperationName() + " does not inherit DbConnection");
			
			Init(dbConn, profiler, autoDisposeConnection);
        }
开发者ID:jin29neci,项目名称:ServiceStack,代码行数:11,代码来源:ProfiledDbConnection.cs

示例8: SimpleProfiledDataReader

        /// <summary>
        /// Initialises a new instance of the <see cref="SimpleProfiledDataReader"/> class.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="profiler">The profiler.</param>
        public SimpleProfiledDataReader(IDataReader reader, IDbProfiler profiler)
        {
            if (reader == null) throw new ArgumentNullException("reader");

            _reader = reader;

            if (profiler != null)
            {
                _profiler = profiler;
            }
        }
开发者ID:rynonl,项目名称:MiniProfiler,代码行数:16,代码来源:SimpleProfiledDataReader.cs

示例9: ProfiledDbConnection

    	public ProfiledDbConnection(IDbConnection connection, IDbProfiler profiler)
    	{
    		var hasConn = connection as IHasDbConnection;
			if (hasConn != null) connection = hasConn.DbConnection;
    		var dbConn = connection as DbConnection;

			if (dbConn == null)
				throw new ArgumentException(connection.GetType().Name + " does not inherit DbConnection");
			
			Init(dbConn, profiler);
        }
开发者ID:austinvernsonger,项目名称:ServiceStack,代码行数:11,代码来源:ProfiledDbConnection.cs

示例10: ProfiledDbConnection

        /// <summary>
        /// Returns a new <see cref="ProfiledDbConnection"/> that wraps <paramref name="connection"/>, 
        /// providing query execution profiling.  If profiler is null, no profiling will occur.
        /// </summary>
        /// <param name="connection">Your provider-specific flavor of connection, e.g. SqlConnection, OracleConnection</param>
        /// <param name="profiler">The currently started <see cref="MiniProfiler"/> or null.</param>
        public ProfiledDbConnection(DbConnection connection, IDbProfiler profiler)
        {
            if (connection == null) throw new ArgumentNullException("connection");

            _conn = connection;
            _conn.StateChange += StateChangeHandler;

            if (profiler != null)
            {
                _profiler = profiler;
            }
        }
开发者ID:7sharp9,项目名称:ServiceStack,代码行数:18,代码来源:ProfiledDbConnection.cs

示例11: ProfiledDbCommand

        public ProfiledDbCommand(DbCommand cmd, DbConnection conn, IDbProfiler profiler)
        {
            if (cmd == null) throw new ArgumentNullException("cmd");

            _cmd = cmd;
            _conn = conn;

            if (profiler != null)
            {
                _profiler = profiler;
            }
        }
开发者ID:namman,项目名称:ServiceStack,代码行数:12,代码来源:ProfiledDbCommand.cs

示例12: Init

        private void Init(DbConnection connection, IDbProfiler profiler, bool autoDisposeConnection)
    	{
    		if (connection == null) throw new ArgumentNullException("connection");

    	    this.autoDisposeConnection = autoDisposeConnection;
    		_conn = connection;
    		_conn.StateChange += StateChangeHandler;

    		if (profiler != null)
    		{
    			_profiler = profiler;
    		}
    	}
开发者ID:jin29neci,项目名称:ServiceStack,代码行数:13,代码来源:ProfiledDbConnection.cs

示例13: ProfiledSqlClientBatchingBatcher

        public ProfiledSqlClientBatchingBatcher(ConnectionManager connectionManager, IInterceptor interceptor)
            : base(connectionManager, interceptor)
        {
            this.batchSize = Factory.Settings.AdoBatchSize;
            this.defaultTimeout = PropertiesHelper.GetInt32(global::NHibernate.Cfg.Environment.CommandTimeout, global::NHibernate.Cfg.Environment.Properties, -1);

            this.currentBatch = this.CreateConfiguredBatch();

            // we always create this, because we need to deal with a scenario in which
            // the user change the logging configuration at runtime. Trying to put this
            // behind an if(log.IsDebugEnabled) will cause a null reference exception 
            // at that point.
            this.currentBatchCommandsLog = new StringBuilder().AppendLine("Batch commands:");
            this.profiler = StackExchange.Profiling.MiniProfiler.Current as IDbProfiler;
        }
开发者ID:bigfont,项目名称:CertifiedOverheadCrane,代码行数:15,代码来源:ProfiledSqlClientBatchingBatcher.cs

示例14: ProfiledDbProviderFactory

        /// <summary>
        /// Initializes a <see cref="ProfiledDbProviderFactory"/>.
        /// </summary>
        /// <param name="dbProviderFactory">The <see cref="DbProviderFactory"/> to be profiled.</param>
        /// <param name="dbProfiler">The <see cref="IDbProfiler"/>.</param>
        public ProfiledDbProviderFactory(DbProviderFactory dbProviderFactory, IDbProfiler dbProfiler)
        {
            if (dbProviderFactory == null)
            {
                throw new ArgumentNullException("dbProviderFactory");
            }

            if (dbProfiler == null)
            {
                throw new ArgumentNullException("dbProfiler");
            }

            _dbProviderFactory = dbProviderFactory;
            _dbProfiler = dbProfiler;
        }
开发者ID:volkd,项目名称:nanoprofiler,代码行数:20,代码来源:ProfiledDbProviderFactory.cs

示例15: ProfiledDbDataReader

        /// <summary>
        /// Initializes a <see cref="ProfiledDbDataReader"/>.
        /// </summary>
        /// <param name="dataReader">The <see cref="IDataReader"/> to be profiled.</param>
        /// <param name="dbProfiler">
        ///     The <see cref="IDbProfiler"/> which profiles the <see cref="IDataReader"/>
        /// </param>
        public ProfiledDbDataReader(IDataReader dataReader, IDbProfiler dbProfiler)
        {
            if (dataReader == null)
            {
                throw new ArgumentNullException("dataReader");
            }

            if (dbProfiler == null)
            {
                throw new ArgumentNullException("dbProfiler");
            }

            _dataReader = dataReader;
            _dbDataReader = dataReader as DbDataReader;
            _dbProfiler = dbProfiler;
        }
开发者ID:volkd,项目名称:nanoprofiler,代码行数:23,代码来源:ProfiledDbDataReader.cs


注:本文中的IDbProfiler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。