コード例 #1
0
        protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior)
        {
            var sw     = Stopwatch.StartNew();
            var reader = _command.ExecuteReader(behavior);

            _hooks.CommandExecuted(this, _context, sw.ElapsedMilliseconds);
            return(reader);
        }
コード例 #2
0
        protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior)
        {
            var start  = Stopwatch.GetTimestamp();
            var reader = _command.ExecuteReader(behavior);

            _hooks.CommandExecuted(this, _context, GetElapsedMilliseconds(start, Stopwatch.GetTimestamp()));
            return(reader);
        }
コード例 #3
0
ファイル: WrappedCommand.cs プロジェクト: hryz/Dapper.Logging
        protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior)
        {
            var sw = Stopwatch.StartNew();

            try
            {
                return(_command.ExecuteReader(behavior));
            }
            finally
            {
                _hooks.CommandExecuted(this, _context, sw.ElapsedMilliseconds);
            }
        }