Open Logerfo opened 4 years ago
Speaking about debugging info, I would like to see "ParameterName = {ParameterName}, Value = {Value}"
for the DbParameter
type. The command type could expose the current state.
@YohDeadfall I have updated the description in order to include your suggestion for the DbParameter
type.
About the DbCommand
type, I don't know what you mean. As far as I know, there is no State
or similar property. It does exist for NpgsqlCommand
, you might be mixing them up.
Sorry, I mean DbConnection
.
OK, updated.
I wonder if there is any security guidance or concerns for using DebuggerDisplayAttribute
on information that is sensitive. ConnectionString
maybe contain a username and password.
@vcsjones I don't think there is any concern, as it probably would for ToString
. If someone has access to the value displayed in the debugger through the attribute of a type, it's sure that they also have access to its members values, including private ones.
Description
As discussed in npgsql/npgsql#2687, some ADO.NET types could benefit from having a
DebuggerDisplayAttribute
. I could send a PR.Which types should have it?
Which types should not have it?
ToString
method, since the debugger uses it by default.Pending questions
,nq
)nameof
? I think so, but read dotnet/corefx#41386, which doesn't.I'm putting up a suggestion list below. This list will be updated as new suggestions are made.
DbCommand
{CommandText}
DbConnection
State = {State}, ConnectionString = {ConnectionString}
DbParameter
ParameterName = {ParameterName}, Value = {Value}
DbParameterCollection
Count = {Count}
DbDataReader
{Command}