diff --git a/doc/snippets/Microsoft.Data/SqlDbTypeExtensions.xml b/doc/snippets/Microsoft.Data/SqlDbTypeExtensions.xml new file mode 100644 index 0000000000..3b2bee83f8 --- /dev/null +++ b/doc/snippets/Microsoft.Data/SqlDbTypeExtensions.xml @@ -0,0 +1,24 @@ + + + + + Extensions for SqlDbType. + + + class provides enums which will be added. These are meant to be used by applications which cannot leverage the enums in available in newer .NET runtime versions. + +]]> + + + + + Gets the enum value for JSON datatype. + + enum value for JSON datatype. + + + + diff --git a/src/Microsoft.Data.SqlClient.sln b/src/Microsoft.Data.SqlClient.sln index f7efd31443..88d02dee48 100644 --- a/src/Microsoft.Data.SqlClient.sln +++ b/src/Microsoft.Data.SqlClient.sln @@ -73,6 +73,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Data", "Microsoft.Data", "{908C7DD3-C999-40A6-9433-9F5ACA7C36F5}" ProjectSection(SolutionItems) = preProject ..\doc\snippets\Microsoft.Data\OperationAbortedException.xml = ..\doc\snippets\Microsoft.Data\OperationAbortedException.xml + ..\doc\snippets\Microsoft.Data\SqlDbTypeExtensions.xml = ..\doc\snippets\Microsoft.Data\SqlDbTypeExtensions.xml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Data.Sql", "Microsoft.Data.Sql", "{0CE216CE-8072-4985-B248-61F0D0BE9C2E}" diff --git a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs index 5dfbf8af3f..cc836fa92f 100644 --- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs +++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs @@ -5,8 +5,6 @@ // NOTE: The current Microsoft.VSDesigner editor attributes are implemented for System.Data.SqlClient, and are not publicly available. // New attributes that are designed to work with Microsoft.Data.SqlClient and are publicly documented should be included in future. -using System; - [assembly: System.CLSCompliant(true)] namespace Microsoft.Data { @@ -15,7 +13,15 @@ public sealed partial class OperationAbortedException : System.SystemException { internal OperationAbortedException() { } } + + /// + public static class SqlDbTypeExtensions + { + /// + public const System.Data.SqlDbType Json = (System.Data.SqlDbType)35; + } } + namespace Microsoft.Data.Sql { /// diff --git a/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs b/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs index d8bbb83106..421dc60d67 100644 --- a/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs +++ b/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs @@ -18,7 +18,15 @@ internal OperationAbortedException() { } private OperationAbortedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } + + /// + public static class SqlDbTypeExtensions + { + /// + public const System.Data.SqlDbType Json = (System.Data.SqlDbType)35; + } } + namespace Microsoft.Data.Sql { /// diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlDbTypeExtensions.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlDbTypeExtensions.cs index 18c53f428b..df7f597517 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlDbTypeExtensions.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlDbTypeExtensions.cs @@ -6,14 +6,10 @@ namespace Microsoft.Data { - /// - /// Extensions for SqlDbType enum to enable its usage. - /// + /// public static class SqlDbTypeExtensions { - /// - /// Represents the JSON Data type in SQL Server. - /// + /// #if NET9_0_OR_GREATER public const SqlDbType Json = SqlDbType.Json; #else