diff --git a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.NetCoreApp.cs index d509a52ee6..78ae387d5e 100644 --- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.NetCoreApp.cs @@ -5,26 +5,6 @@ // Changes to this file must follow the http://aka.ms/api-review process. // ------------------------------------------------------------------------------ -namespace Microsoft.Data.SqlClient.Server -{ - /// - [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue | System.AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] - public partial class SqlFacetAttribute : System.Attribute - { - /// - public SqlFacetAttribute() { } - /// - public bool IsFixedLength { get { throw null; } set { } } - /// - public bool IsNullable { get { throw null; } set { } } - /// - public int MaxSize { get { throw null; } set { } } - /// - public int Precision { get { throw null; } set { } } - /// - public int Scale { get { throw null; } set { } } - } -} namespace Microsoft.Data.SqlClient { public partial class SqlDataReader : System.Data.Common.IDbColumnSchemaGenerator 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 f08e1835ed..af5f5be0be 100644 --- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs +++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs @@ -1675,6 +1675,23 @@ public partial class SqlDataRecord : System.Data.IDataRecord /// public virtual int SetValues(params object[] values) { throw null; } } + /// + [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue | System.AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] + public partial class SqlFacetAttribute : System.Attribute + { + /// + public SqlFacetAttribute() { } + /// + public bool IsFixedLength { get { throw null; } set { } } + /// + public bool IsNullable { get { throw null; } set { } } + /// + public int MaxSize { get { throw null; } set { } } + /// + public int Precision { get { throw null; } set { } } + /// + public int Scale { get { throw null; } set { } } + } /// [System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple = false, Inherited = false), System.SerializableAttribute] public partial class SqlFunctionAttribute : System.Attribute diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj index 797d433b2f..7a23b426bc 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj @@ -108,6 +108,9 @@ Microsoft\Data\SqlClient\Server\SmiXetterTypeCode.cs + + Microsoft\Data\SqlClient\Server\SqlFacetAttribute.cs + Microsoft\Data\SqlClient\Server\SqlFunctionAttribute.cs 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 8fb8e1fed5..c3e7b10802 100644 --- a/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs +++ b/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs @@ -1956,6 +1956,23 @@ public partial class SqlDataRecord : System.Data.IDataRecord /// public virtual int SetValues(params object[] values) { throw null; } } + /// + [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue | System.AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] + public partial class SqlFacetAttribute : System.Attribute + { + /// + public SqlFacetAttribute() { } + /// + public bool IsFixedLength { get { throw null; } set { } } + /// + public bool IsNullable { get { throw null; } set { } } + /// + public int MaxSize { get { throw null; } set { } } + /// + public int Precision { get { throw null; } set { } } + /// + public int Scale { get { throw null; } set { } } + } /// [System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple = false, Inherited = false), System.SerializableAttribute] public partial class SqlFunctionAttribute : System.Attribute diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj index 39a7e2b45c..472218154a 100644 --- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj @@ -160,6 +160,9 @@ Microsoft\Data\SqlClient\Server\SmiXetterTypeCode.cs + + Microsoft\Data\SqlClient\Server\SqlFacetAttribute.cs + Microsoft\Data\SqlClient\Server\SqlFunctionAttribute.cs diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Server/SqlFacetAttribute.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Server/SqlFacetAttribute.cs new file mode 100644 index 0000000000..9d35419da4 --- /dev/null +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Server/SqlFacetAttribute.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Microsoft.Data.SqlClient.Server +{ + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.ReturnValue | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] + public class SqlFacetAttribute : Attribute + { + /// + public SqlFacetAttribute() { } + + /// + public bool IsFixedLength + { + get; + set; + } + + /// + public int MaxSize + { + get; + set; + } + + /// + public int Precision + { + get; + set; + } + + /// + public int Scale + { + get; + set; + } + + /// + public bool IsNullable + { + get; + set; + } + } +} diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj index b6b55561ea..45fb31d420 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj @@ -40,6 +40,7 @@ + diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlFacetAttributeTest.cs b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlFacetAttributeTest.cs new file mode 100644 index 0000000000..7e93f228fa --- /dev/null +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlFacetAttributeTest.cs @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.Data.SqlClient.Server; +using Xunit; + +namespace System.Data.SqlClient.Tests +{ + public class SqlFacetAttributeTests + { + [Fact] + public void Basic() + { + var attrib = new SqlFacetAttribute(); + + attrib.IsFixedLength = true; + attrib.IsNullable = false; + attrib.MaxSize = 123; + attrib.Precision = 234; + attrib.Scale = 345; + + Assert.True(attrib.IsFixedLength); + Assert.False(attrib.IsNullable); + Assert.Equal(123, attrib.MaxSize); + Assert.Equal(234, attrib.Precision); + Assert.Equal(345, attrib.Scale); + } + } +}