fluffynuts commented on code in PR #196: URL: https://github.com/apache/logging-log4net/pull/196#discussion_r1804221191
########## src/log4net.Tests/Appender/AdoNet/Log4NetParameterCollection.cs: ########## @@ -24,45 +24,44 @@ using System.Collections.Generic; using System.Data; -namespace log4net.Tests.Appender.AdoNet +namespace log4net.Tests.Appender.AdoNet; + +public class Log4NetParameterCollection : CollectionBase, IDataParameterCollection { - public class Log4NetParameterCollection : CollectionBase, IDataParameterCollection + private readonly Dictionary<string, int> parameterNameToIndex = new(StringComparer.Ordinal); + + protected override void OnInsertComplete(int index, object? value) { - private readonly Dictionary<string, int> m_parameterNameToIndex = new(StringComparer.Ordinal); + base.OnInsertComplete(index, value); - protected override void OnInsertComplete(int index, object? value) + if (value is IDataParameter param) { - base.OnInsertComplete(index, value); - - if (value is IDataParameter param) - { - m_parameterNameToIndex[param.ParameterName] = index; - } + parameterNameToIndex[param.ParameterName] = index; Review Comment: I'd like to recommend standardising on the default C# style here - private fields should be prefixed with `_` - in particular, that makes it much easier (at least, for me) to determine _where_ a variable comes from - without the `_` prefix, I have to double-check every time whether this is a local or an instance variable. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org