private void OnEventStart(object value)
        {
            var command = ((CommandEventData)value).Command;

            if (command is DbCommand dbCommand)
            {
                SqlRequestUtil.BeginSubsegment(dbCommand);
                SqlRequestUtil.ProcessCommand(dbCommand);
            }
        }
コード例 #2
0
        private void OnEventStart(object value)
        {
            // This class serves for tracing Sql command from both System.Data.SqlClient and Microsoft.Data.SqlClient and using fetch property works
            // fot both of these two cases
            var command = AgentUtil.FetchPropertyUsingReflection(value, "Command");

            if (command is DbCommand dbcommand)
            {
                // Skip processing EntityFramework Core request
                if (SqlRequestUtil.IsTraceable() && CurrentDbCommands.TryAdd(dbcommand, null))
                {
                    SqlRequestUtil.BeginSubsegment(dbcommand);
                    SqlRequestUtil.ProcessCommand(dbcommand);
                }
            }
        }
コード例 #3
0
 private void OnCommandStart(DbCommand command)
 {
     SqlRequestUtil.BeginSubsegment(command);
     SqlRequestUtil.ProcessCommand(command);
 }