Skip to content

Commit 23770cd

Browse files
Add a doc comment to indicate that the Operators property shouldn't be used
1 parent cac3467 commit 23770cd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Serilog.Enrichers.Sensitive/SensitiveDataEnricherOptions.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ namespace Serilog.Enrichers.Sensitive
77
{
88
public class SensitiveDataEnricherOptions
99
{
10-
private string[] _operators;
10+
private string[]? _operators;
1111

12+
// ReSharper disable once UnusedMember.Global as this only exists to support JSON configuration. See issue #25
1213
public SensitiveDataEnricherOptions()
1314
{
1415
}
@@ -19,6 +20,7 @@ public SensitiveDataEnricherOptions(
1920
IEnumerable<string>? maskingOperators = null,
2021
IEnumerable<string>? maskProperties = null,
2122
IEnumerable<string>? excludeProperties = null,
23+
// ReSharper disable once UnusedParameter.Local as this only exists to support JSON configuration, see the Operators property below
2224
IEnumerable<string>? operators = null)
2325
{
2426
Mode = mode;
@@ -98,12 +100,12 @@ private static List<IMaskingOperator> ResolveMaskingOperators(IEnumerable<string
98100
/// </remarks>
99101
public List<string> ExcludeProperties { get; set; } = new List<string>();
100102

101-
public string[] Operators
103+
/// <remarks>
104+
/// This property only exists to support JSON configuration of the enricher. If you are configuring the enricher from code you'll want <see cref="MaskingOperators"/> instead.
105+
/// </remarks>
106+
public string[]? Operators
102107
{
103-
get
104-
{
105-
return _operators;
106-
}
108+
get => _operators;
107109
set
108110
{
109111
_operators = value;

0 commit comments

Comments
 (0)