DatabaseLogFormatter.GetStopwatch(DbCommandInterceptionContext) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
用于时间执行的秒表。 此秒表在结尾NonQueryExecuting(DbCommand, DbCommandInterceptionContext<Int32>)处启动,ScalarExecuting(DbCommand, DbCommandInterceptionContext<Object>)方法ReaderExecuting(DbCommand, DbCommandInterceptionContext<DbDataReader>)在开头和方法处NonQueryExecuted(DbCommand, DbCommandInterceptionContext<Int32>)ScalarExecuted(DbCommand, DbCommandInterceptionContext<Object>)ReaderExecuted(DbCommand, DbCommandInterceptionContext<DbDataReader>)停止。 如果重写了这些方法,并且正在使用秒表,则替代应调用基方法或启动/停止秒表本身。
protected internal System.Diagnostics.Stopwatch GetStopwatch(System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext interceptionContext);
member this.GetStopwatch : System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext -> System.Diagnostics.Stopwatch
Protected Friend Function GetStopwatch (interceptionContext As DbCommandInterceptionContext) As Stopwatch
参数
- interceptionContext
- DbCommandInterceptionContext
将为其获取秒表的拦截上下文。
返回
秒表。