-
Notifications
You must be signed in to change notification settings - Fork 317
Fix bunch of annontations #1959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
2b2b4b8
6565ab8
919e6f3
21afb66
dfbf46a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| using System.Data.Common; | ||
| using System.Data.SqlTypes; | ||
| using System.Diagnostics; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using System.Globalization; | ||
| using System.IO; | ||
| using System.Reflection; | ||
|
|
@@ -438,6 +439,10 @@ internal void Bind(TdsParserStateObject stateObj) | |
| _defaultLCID = _parser.DefaultLCID; | ||
| } | ||
|
|
||
| #if NET6_0_OR_GREATER | ||
| [SuppressMessage("ReflectionAnalysis", "IL2111", | ||
| Justification = "System.Type.TypeInitializer would not be used in dataType and providerSpecificDataType columns.")] | ||
| #endif | ||
| internal DataTable BuildSchemaTable() | ||
| { | ||
| _SqlMetaDataSet md = this.MetaData; | ||
|
|
@@ -1232,6 +1237,11 @@ override public IEnumerator GetEnumerator() | |
| } | ||
|
|
||
| /// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml' path='docs/members[@name="SqlDataReader"]/GetFieldType/*' /> | ||
| #if NET6_0_OR_GREATER | ||
| [SuppressMessage("ReflectionAnalysis", "IL2093:MismatchOnMethodReturnValueBetweenOverrides", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What kind of annotations? and were they shipped in 7?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think issue was that ref assembly was missing this annotations. and yes, it was fixed in .NET 7 (or even .NET 8) |
||
| Justification = "Annotations for DbDataReader was not shipped in net6.0")] | ||
| [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] | ||
| #endif | ||
| override public Type GetFieldType(int i) | ||
| { | ||
| SqlStatistics statistics = null; | ||
|
|
@@ -1248,6 +1258,9 @@ override public Type GetFieldType(int i) | |
| } | ||
| } | ||
|
|
||
| #if NET6_0_OR_GREATER | ||
| [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] | ||
| #endif | ||
| private Type GetFieldTypeInternal(_SqlMetaData metaData) | ||
| { | ||
| Type fieldType = null; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| using System.Data; | ||
| using System.Data.SqlTypes; | ||
| using System.Diagnostics; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using System.Globalization; | ||
|
|
||
| namespace Microsoft.Data.SqlClient.Server | ||
|
|
@@ -228,6 +229,9 @@ internal SmiMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType | ||
| ) | ||
| : this( | ||
|
|
@@ -253,6 +257,9 @@ internal SmiMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| bool isMultiValued, | ||
| IList<SmiExtendedMetaData> fieldTypes, | ||
|
|
@@ -282,6 +289,9 @@ internal SmiMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| string udtAssemblyQualifiedName, | ||
| bool isMultiValued, | ||
|
|
@@ -759,6 +769,9 @@ internal SmiExtendedMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| string name, | ||
| string typeSpecificNamePart1, | ||
|
|
@@ -792,6 +805,9 @@ internal SmiExtendedMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| bool isMultiValued, | ||
| IList<SmiExtendedMetaData> fieldMetaData, | ||
|
|
@@ -829,6 +845,9 @@ internal SmiExtendedMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| string udtAssemblyQualifiedName, | ||
| bool isMultiValued, | ||
|
|
@@ -903,6 +922,9 @@ internal SmiParameterMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| bool isMultiValued, | ||
| IList<SmiExtendedMetaData> fieldMetaData, | ||
|
|
@@ -942,6 +964,9 @@ internal SmiParameterMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like that this isn't clear that it applies to the parameter following the #endif but i can't see another way to format the code to make it clear :(
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's unfortunate. |
||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| string udtAssemblyQualifiedName, | ||
| bool isMultiValued, | ||
|
|
@@ -1020,6 +1045,9 @@ internal SmiStorageMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| string name, | ||
| string typeSpecificNamePart1, | ||
|
|
@@ -1069,6 +1097,9 @@ internal SmiStorageMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| bool isMultiValued, | ||
| IList<SmiExtendedMetaData> fieldMetaData, | ||
|
|
@@ -1123,6 +1154,9 @@ internal SmiStorageMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| string udtAssemblyQualifiedName, | ||
| bool isMultiValued, | ||
|
|
@@ -1233,6 +1267,9 @@ internal SmiQueryMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| string name, | ||
| string typeSpecificNamePart1, | ||
|
|
@@ -1290,6 +1327,9 @@ internal SmiQueryMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| bool isMultiValued, | ||
| IList<SmiExtendedMetaData> fieldMetaData, | ||
|
|
@@ -1352,6 +1392,9 @@ internal SmiQueryMetaData( | |
| byte scale, | ||
| long localeId, | ||
| SqlCompareOptions compareOptions, | ||
| #if NET6_0_OR_GREATER | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] | ||
| #endif | ||
| Type userDefinedType, | ||
| string udtAssemblyQualifiedName, | ||
| bool isMultiValued, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.