Skip to content

Commit 72a08e9

Browse files
authored
Data.Common add DynamicallyAccessMembers attribs (#75961)
The existing APICompat tooling doesn't indicate a compatibility error when comparing the contract assembly against the implementation assembly and the `[return: ...]` attributes aren't in sync. The new tooling that is being bootstrapped in dotnet/runtime via #73263 does flag them. In this case a few type members were missing the `DynamicallyAccessedMembers` return attribute in the contract.
1 parent 3c01d17 commit 72a08e9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/libraries/System.Data.Common/ref/System.Data.Common.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ public override void Close() { }
940940
public override decimal GetDecimal(int ordinal) { throw null; }
941941
public override double GetDouble(int ordinal) { throw null; }
942942
public override System.Collections.IEnumerator GetEnumerator() { throw null; }
943+
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
943944
public override System.Type GetFieldType(int ordinal) { throw null; }
944945
public override float GetFloat(int ordinal) { throw null; }
945946
public override System.Guid GetGuid(int ordinal) { throw null; }
@@ -948,6 +949,7 @@ public override void Close() { }
948949
public override long GetInt64(int ordinal) { throw null; }
949950
public override string GetName(int ordinal) { throw null; }
950951
public override int GetOrdinal(string name) { throw null; }
952+
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
951953
public override System.Type GetProviderSpecificFieldType(int ordinal) { throw null; }
952954
public override object GetProviderSpecificValue(int ordinal) { throw null; }
953955
public override int GetProviderSpecificValues(object[] values) { throw null; }
@@ -2318,6 +2320,7 @@ protected virtual void Dispose(bool disposing) { }
23182320
public abstract double GetDouble(int ordinal);
23192321
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
23202322
public abstract System.Collections.IEnumerator GetEnumerator();
2323+
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
23212324
public abstract System.Type GetFieldType(int ordinal);
23222325
public System.Threading.Tasks.Task<T> GetFieldValueAsync<T>(int ordinal) { throw null; }
23232326
public virtual System.Threading.Tasks.Task<T> GetFieldValueAsync<T>(int ordinal, System.Threading.CancellationToken cancellationToken) { throw null; }
@@ -2330,6 +2333,7 @@ protected virtual void Dispose(bool disposing) { }
23302333
public abstract string GetName(int ordinal);
23312334
public abstract int GetOrdinal(string name);
23322335
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
2336+
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
23332337
public virtual System.Type GetProviderSpecificFieldType(int ordinal) { throw null; }
23342338
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
23352339
public virtual object GetProviderSpecificValue(int ordinal) { throw null; }
@@ -2376,6 +2380,7 @@ protected DbDataRecord() { }
23762380
protected virtual System.Data.Common.DbDataReader GetDbDataReader(int i) { throw null; }
23772381
public abstract decimal GetDecimal(int i);
23782382
public abstract double GetDouble(int i);
2383+
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
23792384
public abstract System.Type GetFieldType(int i);
23802385
public abstract float GetFloat(int i);
23812386
public abstract System.Guid GetGuid(int i);

0 commit comments

Comments
 (0)