Skip to content

Commit dc19dcd

Browse files
remove redundant Attribute( suffixes (#4158)
Co-authored-by: Paul Medynski <31868385+paulmedynski@users.noreply.github.com>
1 parent 3a3181a commit dc19dcd

8 files changed

Lines changed: 62 additions & 62 deletions

File tree

src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionString.netfx.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ private void ValidateCombinedSet(DbConnectionString componentSet, DbConnectionSt
326326
HashSet<string> component = new HashSet<string>(componentSet._restrictionValues);
327327
combined.ExceptWith(component);
328328
Debug.Assert(combined.Count == 0, "Combined set allows values not allowed by component set");
329-
#endif
329+
#endif
330330
}
331331
else if (combinedSet._behavior == KeyRestrictionBehavior.PreventUsage)
332332
{
@@ -350,7 +350,7 @@ private void ValidateCombinedSet(DbConnectionString componentSet, DbConnectionSt
350350
HashSet<string> component = new HashSet<string>(componentSet._restrictionValues);
351351
combined.IntersectWith(component);
352352
Debug.Assert(combined.Count == 0, "Combined values allows values prevented by component set");
353-
#endif
353+
#endif
354354
}
355355
else if (combinedSet._behavior == KeyRestrictionBehavior.PreventUsage)
356356
{
@@ -362,7 +362,7 @@ private void ValidateCombinedSet(DbConnectionString componentSet, DbConnectionSt
362362
HashSet<string> component = new HashSet<string>(componentSet._restrictionValues);
363363
component.IntersectWith(combined);
364364
Debug.Assert(component.Count == 0, "Combined values does not prevent all of the values prevented by the component set");
365-
#endif
365+
#endif
366366
}
367367
else
368368
{
@@ -564,7 +564,7 @@ static internal string[] RemoveDuplicates(string[] restrictions)
564564
return restrictions;
565565
}
566566

567-
[ConditionalAttribute("DEBUG")]
567+
[Conditional("DEBUG")]
568568
private static void Verify(string[] restrictionValues)
569569
{
570570
if (restrictionValues != null)

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommandBuilder.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public SqlCommandBuilder(SqlDataAdapter adapter) : this()
3737
/// <devnote>SqlServer only supports CatalogLocation.Start</devnote>
3838
[
3939
Browsable(false),
40-
EditorBrowsableAttribute(EditorBrowsableState.Never),
40+
EditorBrowsable(EditorBrowsableState.Never),
4141
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
4242
]
4343
public override CatalogLocation CatalogLocation
@@ -59,7 +59,7 @@ public override CatalogLocation CatalogLocation
5959
/// <devnote>SqlServer only supports '.'</devnote>
6060
[
6161
Browsable(false),
62-
EditorBrowsableAttribute(EditorBrowsableState.Never),
62+
EditorBrowsable(EditorBrowsableState.Never),
6363
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
6464
]
6565
public override string CatalogSeparator
@@ -80,8 +80,8 @@ public override string CatalogSeparator
8080
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlCommandBuilder.xml' path='docs/members[@name="SqlCommandBuilder"]/DataAdapter/*'/>
8181
[
8282
DefaultValue(null),
83-
ResCategoryAttribute(nameof(Strings.DataCategory_Update)),
84-
ResDescriptionAttribute(nameof(Strings.SqlCommandBuilder_DataAdapter)),
83+
ResCategory(nameof(Strings.DataCategory_Update)),
84+
ResDescription(nameof(Strings.SqlCommandBuilder_DataAdapter)),
8585
]
8686
public new SqlDataAdapter DataAdapter
8787
{
@@ -99,7 +99,7 @@ public override string CatalogSeparator
9999
/// <devnote>SqlServer only supports '.'</devnote>
100100
[
101101
Browsable(false),
102-
EditorBrowsableAttribute(EditorBrowsableState.Never),
102+
EditorBrowsable(EditorBrowsableState.Never),
103103
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
104104
]
105105
public override string QuotePrefix
@@ -121,7 +121,7 @@ public override string QuotePrefix
121121
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlCommandBuilder.xml' path='docs/members[@name="SqlCommandBuilder"]/QuoteSuffix/*'/>
122122
[
123123
Browsable(false),
124-
EditorBrowsableAttribute(EditorBrowsableState.Never),
124+
EditorBrowsable(EditorBrowsableState.Never),
125125
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
126126
]
127127
public override string QuoteSuffix
@@ -143,7 +143,7 @@ public override string QuoteSuffix
143143
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlCommandBuilder.xml' path='docs/members[@name="SqlCommandBuilder"]/SchemaSeparator/*'/>
144144
[
145145
Browsable(false),
146-
EditorBrowsableAttribute(EditorBrowsableState.Never),
146+
EditorBrowsable(EditorBrowsableState.Never),
147147
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
148148
]
149149
public override string SchemaSeparator

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnection.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,19 @@ public SqlRetryLogicBaseProvider RetryLogicProvider
163163

164164
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/ColumnEncryptionKeyCacheTtl/*' />
165165
[DefaultValue(null)]
166-
[ResCategoryAttribute(nameof(Strings.DataCategory_Data))]
166+
[ResCategory(nameof(Strings.DataCategory_Data))]
167167
[ResDescription(nameof(Strings.TCE_SqlConnection_ColumnEncryptionKeyCacheTtl))]
168168
public static TimeSpan ColumnEncryptionKeyCacheTtl { get; set; } = TimeSpan.FromHours(2);
169169

170170
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/ColumnEncryptionQueryMetadataCacheEnabled/*' />
171171
[DefaultValue(null)]
172-
[ResCategoryAttribute(nameof(Strings.DataCategory_Data))]
172+
[ResCategory(nameof(Strings.DataCategory_Data))]
173173
[ResDescription(nameof(Strings.TCE_SqlConnection_ColumnEncryptionQueryMetadataCacheEnabled))]
174174
public static bool ColumnEncryptionQueryMetadataCacheEnabled { get; set; } = true;
175175

176176
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/ColumnEncryptionTrustedMasterKeyPaths/*' />
177177
[DefaultValue(null)]
178-
[ResCategoryAttribute(nameof(Strings.DataCategory_Data))]
178+
[ResCategory(nameof(Strings.DataCategory_Data))]
179179
[ResDescription(nameof(Strings.TCE_SqlConnection_TrustedColumnMasterKeyPaths))]
180180
public static IDictionary<string, IList<string>> ColumnEncryptionTrustedMasterKeyPaths => _ColumnEncryptionTrustedMasterKeyPaths;
181181

@@ -265,7 +265,7 @@ private SqlConnection(SqlConnection connection)
265265

266266
internal static bool TryGetSystemColumnEncryptionKeyStoreProvider(string keyStoreName, out SqlColumnEncryptionKeyStoreProvider provider)
267267
{
268-
return s_systemColumnEncryptionKeyStoreProviders.TryGetValue(keyStoreName, out provider);
268+
return s_systemColumnEncryptionKeyStoreProviders.TryGetValue(keyStoreName, out provider);
269269
}
270270

271271
/// <summary>
@@ -508,7 +508,7 @@ private void CacheConnectionStringProperties()
508508
// connect the parser to the object.
509509
// if there is no parser at this time we need to connect it after creation.
510510
[DefaultValue(false)]
511-
[ResCategoryAttribute(nameof(Strings.DataCategory_Data))]
511+
[ResCategory(nameof(Strings.DataCategory_Data))]
512512
[ResDescription(nameof(Strings.SqlConnection_StatisticsEnabled))]
513513
public bool StatisticsEnabled
514514
{
@@ -642,9 +642,9 @@ internal int ConnectRetryInterval
642642
#pragma warning disable 618 // ignore obsolete warning about RecommendedAsConfigurable to use SettingsBindableAttribute
643643
[RecommendedAsConfigurable(true)]
644644
#pragma warning restore 618
645-
[SettingsBindableAttribute(true)]
645+
[SettingsBindable(true)]
646646
[RefreshProperties(RefreshProperties.All)]
647-
[ResCategoryAttribute(nameof(Strings.DataCategory_Data))]
647+
[ResCategory(nameof(Strings.DataCategory_Data))]
648648
[ResDescription(nameof(Strings.SqlConnection_ConnectionString))]
649649
public override string ConnectionString
650650
{
@@ -1190,7 +1190,7 @@ protected override DbProviderFactory DbProviderFactory
11901190
//
11911191

11921192
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/InfoMessage/*' />
1193-
[ResCategoryAttribute(nameof(Strings.DataCategory_InfoMessage))]
1193+
[ResCategory(nameof(Strings.DataCategory_InfoMessage))]
11941194
[ResDescription(nameof(Strings.DbConnection_InfoMessage))]
11951195
#if NET
11961196
public event SqlInfoMessageEventHandler InfoMessage;
@@ -1320,7 +1320,7 @@ public override void ChangeDatabase(string database)
13201320
SqlStatistics statistics = null;
13211321
RepairInnerConnection();
13221322
SqlClientEventSource.Log.TryCorrelationTraceEvent("SqlConnection.ChangeDatabase | API | Correlation | Object Id {0}, Activity Id {1}, Database {2}", ObjectID, ActivityCorrelator.Current, database);
1323-
1323+
13241324
try
13251325
{
13261326
statistics = SqlStatistics.StartTimer(Statistics);
@@ -1396,7 +1396,7 @@ public override void Close()
13961396

13971397
SqlStatistics statistics = null;
13981398
Exception e = null;
1399-
1399+
14001400
try
14011401
{
14021402
statistics = SqlStatistics.StartTimer(Statistics);
@@ -1889,7 +1889,7 @@ internal void Abort(Exception e)
18891889
}
18901890

18911891
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/OpenAsync/*' />
1892-
public override Task OpenAsync(CancellationToken cancellationToken)
1892+
public override Task OpenAsync(CancellationToken cancellationToken)
18931893
=> OpenAsync(SqlConnectionOverrides.None, cancellationToken);
18941894

18951895
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/OpenAsyncWithOverrides/*' />

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataAdapter.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ private SqlDataAdapter(SqlDataAdapter from) : base(from)
6666

6767
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataAdapter.xml' path='docs/members[@name="SqlDataAdapter"]/DeleteCommand/*' />
6868
[DefaultValue(null)]
69-
[ResCategoryAttribute(nameof(Strings.DataCategory_Update))]
70-
[ResDescriptionAttribute(nameof(Strings.DbDataAdapter_DeleteCommand))]
69+
[ResCategory(nameof(Strings.DataCategory_Update))]
70+
[ResDescription(nameof(Strings.DbDataAdapter_DeleteCommand))]
7171
new public SqlCommand DeleteCommand
7272
{
7373
get { return _deleteCommand; }
@@ -83,8 +83,8 @@ IDbCommand IDbDataAdapter.DeleteCommand
8383

8484
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataAdapter.xml' path='docs/members[@name="SqlDataAdapter"]/InsertCommand/*' />
8585
[DefaultValue(null)]
86-
[ResCategoryAttribute(nameof(Strings.DataCategory_Update))]
87-
[ResDescriptionAttribute(nameof(Strings.DbDataAdapter_InsertCommand))]
86+
[ResCategory(nameof(Strings.DataCategory_Update))]
87+
[ResDescription(nameof(Strings.DbDataAdapter_InsertCommand))]
8888
new public SqlCommand InsertCommand
8989
{
9090
get { return _insertCommand; }
@@ -100,8 +100,8 @@ IDbCommand IDbDataAdapter.InsertCommand
100100

101101
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataAdapter.xml' path='docs/members[@name="SqlDataAdapter"]/SelectCommand/*' />
102102
[DefaultValue(null)]
103-
[ResCategoryAttribute(nameof(Strings.DataCategory_Fill))]
104-
[ResDescriptionAttribute(nameof(Strings.DbDataAdapter_SelectCommand))]
103+
[ResCategory(nameof(Strings.DataCategory_Fill))]
104+
[ResDescription(nameof(Strings.DbDataAdapter_SelectCommand))]
105105
new public SqlCommand SelectCommand
106106
{
107107
get { return _selectCommand; }
@@ -117,8 +117,8 @@ IDbCommand IDbDataAdapter.SelectCommand
117117

118118
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataAdapter.xml' path='docs/members[@name="SqlDataAdapter"]/UpdateCommand/*' />
119119
[DefaultValue(null)]
120-
[ResCategoryAttribute(nameof(Strings.DataCategory_Update))]
121-
[ResDescriptionAttribute(nameof(Strings.DbDataAdapter_UpdateCommand))]
120+
[ResCategory(nameof(Strings.DataCategory_Update))]
121+
[ResDescription(nameof(Strings.DbDataAdapter_UpdateCommand))]
122122
new public SqlCommand UpdateCommand
123123
{
124124
get { return _updateCommand; }
@@ -243,8 +243,8 @@ protected override RowUpdatingEventArgs CreateRowUpdatingEvent(DataRow dataRow,
243243
}
244244

245245
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataAdapter.xml' path='docs/members[@name="SqlDataAdapter"]/RowUpdated/*' />
246-
[ResCategoryAttribute(nameof(Strings.DataCategory_Update))]
247-
[ResDescriptionAttribute(nameof(Strings.DbDataAdapter_RowUpdated))]
246+
[ResCategory(nameof(Strings.DataCategory_Update))]
247+
[ResDescription(nameof(Strings.DbDataAdapter_RowUpdated))]
248248
public event SqlRowUpdatedEventHandler RowUpdated
249249
{
250250
add
@@ -258,8 +258,8 @@ public event SqlRowUpdatedEventHandler RowUpdated
258258
}
259259

260260
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataAdapter.xml' path='docs/members[@name="SqlDataAdapter"]/RowUpdating/*' />
261-
[ResCategoryAttribute(nameof(Strings.DataCategory_Update))]
262-
[ResDescriptionAttribute(nameof(Strings.DbDataAdapter_RowUpdating))]
261+
[ResCategory(nameof(Strings.DataCategory_Update))]
262+
[ResDescription(nameof(Strings.DbDataAdapter_RowUpdating))]
263263
public event SqlRowUpdatingEventHandler RowUpdating
264264
{
265265
add

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataReader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,7 @@ override public TextReader GetTextReader(int i)
20752075
}
20762076

20772077
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml' path='docs/members[@name="SqlDataReader"]/GetChar/*' />
2078-
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
2078+
[EditorBrowsable(EditorBrowsableState.Never)]
20792079
override public char GetChar(int i)
20802080
{
20812081
throw ADP.NotSupported();
@@ -2388,7 +2388,7 @@ internal long GetStreamingXmlChars(int i, long dataIndex, char[] buffer, int buf
23882388

23892389
#if NETFRAMEWORK
23902390
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml' path='docs/members[@name="SqlDataReader"]/System.Data.IDataRecord.GetData/*' />
2391-
[EditorBrowsableAttribute(EditorBrowsableState.Never)] // MDAC 69508
2391+
[EditorBrowsable(EditorBrowsableState.Never)] // MDAC 69508
23922392
IDataReader IDataRecord.GetData(int i)
23932393
{
23942394
throw ADP.NotSupported();

0 commit comments

Comments
 (0)