StackExchange.Profiling.SqlTiming.GetCommandParameters C# (CSharp) Method

GetCommandParameters() private method

get the command parameters.
private GetCommandParameters ( IDbCommand command ) : List
command IDbCommand The command.
return List
        private List<SqlTimingParameter> GetCommandParameters(IDbCommand command)
        {
            if (command.Parameters == null || command.Parameters.Count == 0) return null;

            var result = new List<SqlTimingParameter>();

            foreach (DbParameter parameter in command.Parameters)
            {
                if (!string.IsNullOrWhiteSpace(parameter.ParameterName))
                {
                    result.Add(new SqlTimingParameter
                    {
                        ParentSqlTimingId = Id,
                        Name = parameter.ParameterName.Trim(),
                        Value = GetValue(parameter),
                        DbType = GetDbType(parameter),
                        Size = GetParameterSize(parameter)
                    });
                }
            }

            return result;
        }