C# Class StackExchange.Profiling.SqlTiming

ファイルを表示 Open project: NGPVAN/MiniProfiler Class Usage Examples

Private Properties

Property Type Description
AddSpacesToParameters string
GetCommandParameters List
GetDbType string
GetDurationMilliseconds decimal
GetParameterSize int
GetValue string
SqlTiming System

Public Methods

Method Description
Equals ( object rValue ) : bool

Returns true if Ids match.

ExecutionComplete ( bool isReader ) : void

Called when command execution is finished to determine this SqlTiming's duration.

GetHashCode ( ) : int

Returns hash code of Id.

ReaderFetchComplete ( ) : void

Called when database reader is closed, ending profiling for StackExchange.Profiling.Data.ExecuteType.Reader SqlTimings.

SqlTiming ( IDbCommand command, ExecuteType type, StackExchange.Profiling.MiniProfiler profiler ) : System

Initialises a new instance of the SqlTiming class. Creates a new SqlTiming to profile 'command'.

ToString ( ) : string

Returns a snippet of the SQL command and the duration.

Private Methods

Method Description
AddSpacesToParameters ( string commandString ) : string

To help with display, put some space around sammiched commas

GetCommandParameters ( IDbCommand command ) : List

get the command parameters.

GetDbType ( IDataParameter parameter ) : string

Returns the DbType as string, accounting for table parameter types

GetDurationMilliseconds ( ) : decimal

get the duration in milliseconds.

GetParameterSize ( IDbDataParameter parameter ) : int

get the parameter size.

GetValue ( IDataParameter parameter ) : string

Returns the value of parameter suitable for storage/display.

SqlTiming ( ) : System

Method Details

Equals() public method

Returns true if Ids match.
public Equals ( object rValue ) : bool
rValue object /// The rValue. ///
return bool

ExecutionComplete() public method

Called when command execution is finished to determine this SqlTiming's duration.
public ExecutionComplete ( bool isReader ) : void
isReader bool The Reader.
return void

GetHashCode() public method

Returns hash code of Id.
public GetHashCode ( ) : int
return int

ReaderFetchComplete() public method

Called when database reader is closed, ending profiling for StackExchange.Profiling.Data.ExecuteType.Reader SqlTimings.
public ReaderFetchComplete ( ) : void
return void

SqlTiming() public method

Initialises a new instance of the SqlTiming class. Creates a new SqlTiming to profile 'command'.
public SqlTiming ( IDbCommand command, ExecuteType type, StackExchange.Profiling.MiniProfiler profiler ) : System
command IDbCommand The command.
type ExecuteType The type.
profiler StackExchange.Profiling.MiniProfiler The profiler.
return System

ToString() public method

Returns a snippet of the SQL command and the duration.
public ToString ( ) : string
return string