Skip to content

Commit 51a46b6

Browse files
authored
Merge branch 'main' into add-unit-test-project
2 parents 7b175fd + 01f85bf commit 51a46b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1331
-942
lines changed

build.proj

Lines changed: 60 additions & 52 deletions
Large diffs are not rendered by default.

src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public SqlJson(string jsonString) { }
115115
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlJson.xml' path='docs/members[@name="SqlJson"]/ctor3/*' />
116116
public SqlJson(System.Text.Json.JsonDocument jsonDoc) { }
117117
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlJson.xml' path='docs/members[@name="SqlJson"]/IsNull/*' />
118-
public bool IsNull => throw null;
118+
public bool IsNull => throw null;
119119
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlJson.xml' path='docs/members[@name="SqlJson"]/Null/*' />
120120
public static SqlJson Null => throw null;
121121
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlTypes/SqlJson.xml' path='docs/members[@name="SqlJson"]/Value/*' />
@@ -458,12 +458,14 @@ internal SqlClientFactory() { }
458458
public override System.Data.Common.DbParameter CreateParameter() { throw null; }
459459
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientFactory.xml' path='docs/members[@name="SqlClientFactory"]/CreateDataSourceEnumerator/*'/>
460460
public override System.Data.Common.DbDataSourceEnumerator CreateDataSourceEnumerator() { throw null; }
461+
#if NET
461462
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientFactory.xml' path='docs/members[@name="SqlClientFactory"]/CanCreateBatch/*'/>
462463
public override bool CanCreateBatch { get { throw null; } }
463464
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientFactory.xml' path='docs/members[@name="SqlClientFactory"]/CreateBatch/*'/>
464465
public override System.Data.Common.DbBatch CreateBatch() { throw null; }
465466
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientFactory.xml' path='docs/members[@name="SqlClientFactory"]/CreateBatchCommand/*'/>
466467
public override System.Data.Common.DbBatchCommand CreateBatchCommand() { throw null; }
468+
#endif
467469
}
468470
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientLogger.xml' path='docs/members[@name="SqlClientLogger"]/SqlClientLogger/*'/>
469471
public partial class SqlClientLogger
@@ -531,7 +533,7 @@ public enum SqlConnectionAttestationProtocol
531533
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnectionAttestationProtocol.xml' path='docs/members[@name="SqlConnectionAttestationProtocol"]/HGS/*' />
532534
HGS = 3
533535
}
534-
536+
535537
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnectionIPAddressPreference.xml' path='docs/members[@name="SqlConnectionIPAddressPreference"]/SqlConnectionIPAddressPreference/*' />
536538
public enum SqlConnectionIPAddressPreference
537539
{
@@ -1272,7 +1274,7 @@ internal SqlDataReader() { }
12721274
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml' path='docs/members[@name="SqlDataReader"]/RecordsAffected/*'/>
12731275
public override int RecordsAffected { get { throw null; } }
12741276
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml' path='docs/members[@name="SqlDataReader"]/SensitivityClassification/*'/>
1275-
public Microsoft.Data.SqlClient.DataClassification.SensitivityClassification SensitivityClassification { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
1277+
public Microsoft.Data.SqlClient.DataClassification.SensitivityClassification SensitivityClassification { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
12761278
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml' path='docs/members[@name="SqlDataReader"]/VisibleFieldCount/*'/>
12771279
public override int VisibleFieldCount { get { throw null; } }
12781280
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml' path='docs/members[@name="SqlDataReader"]/Close/*'/>
@@ -1499,7 +1501,9 @@ internal SqlException() { }
14991501
public byte State { get { throw null; } }
15001502

15011503
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlException.xml' path='docs/members[@name="SqlException"]/GetObjectData/*'/>
1504+
#if NET
15021505
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId = "SYSLIB0051", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
1506+
#endif
15031507
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) { }
15041508
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlException.xml' path='docs/members[@name="SqlException"]/ToString/*'/>
15051509
public override string ToString() { throw null; }
@@ -1639,7 +1643,7 @@ public SqlParameter(string parameterName, object value) { }
16391643
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
16401644
public override System.Data.ParameterDirection Direction { get { throw null; } set { } }
16411645
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlParameter.xml' path='docs/members[@name="SqlParameter"]/ForceColumnEncryption/*'/>
1642-
public bool ForceColumnEncryption { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
1646+
public bool ForceColumnEncryption { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
16431647
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlParameter.xml' path='docs/members[@name="SqlParameter"]/IsNullable/*'/>
16441648
[System.ComponentModel.DefaultValueAttribute(false)]
16451649
public override bool IsNullable { get { throw null; } set { } }
@@ -1831,11 +1835,19 @@ public override void Commit() { }
18311835
protected override void Dispose(bool disposing) { }
18321836
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlTransaction.xml' path='docs/members[@name="SqlTransaction"]/Rollback1/*'/>
18331837
public override void Rollback() { }
1838+
#if NET
18341839
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlTransaction.xml' path='docs/members[@name="SqlTransaction"]/Rollback2/*'/>
18351840
public override void Rollback(string transactionName) { }
18361841

18371842
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlTransaction.xml' path='docs/members[@name="SqlTransaction"]/Save/*'/>
18381843
public override void Save(string savePointName) { }
1844+
#else
1845+
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlTransaction.xml' path='docs/members[@name="SqlTransaction"]/Rollback2/*'/>
1846+
public void Rollback(string transactionName) { }
1847+
1848+
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlTransaction.xml' path='docs/members[@name="SqlTransaction"]/Save/*'/>
1849+
public void Save(string savePointName) { }
1850+
#endif
18391851
}
18401852
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlRetryingEventArgs.xml' path='docs/members[@name="SqlRetryingEventArgs"]/SqlRetryingEventArgs/*' />
18411853
public sealed class SqlRetryingEventArgs : System.EventArgs
@@ -2713,27 +2725,27 @@ public partial class ColumnSensitivity
27132725
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/ColumnSensitivity.xml' path='docs/members[@name="ColumnSensitivity"]/ctor/*' />
27142726
public ColumnSensitivity(System.Collections.Generic.IList<Microsoft.Data.SqlClient.DataClassification.SensitivityProperty> sensitivityProperties) { }
27152727
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/ColumnSensitivity.xml' path='docs/members[@name="ColumnSensitivity"]/GetSensitivityProperties/*' />
2716-
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Data.SqlClient.DataClassification.SensitivityProperty> SensitivityProperties { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
2728+
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Data.SqlClient.DataClassification.SensitivityProperty> SensitivityProperties { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
27172729
}
27182730
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/InformationType.xml' path='docs/members[@name="InformationType"]/InformationType/*' />
27192731
public partial class InformationType
27202732
{
27212733
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/InformationType.xml' path='docs/members[@name="InformationType"]/ctor/*' />
27222734
public InformationType(string name, string id) { }
27232735
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/InformationType.xml' path='docs/members[@name="InformationType"]/Id/*' />
2724-
public string Id { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
2736+
public string Id { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
27252737
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/InformationType.xml' path='docs/members[@name="InformationType"]/Name/*' />
2726-
public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
2738+
public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
27272739
}
27282740
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/Label.xml' path='docs/members[@name="Label"]/Label/*' />
27292741
public partial class Label
27302742
{
27312743
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/Label.xml' path='docs/members[@name="Label"]/ctor/*' />
27322744
public Label(string name, string id) { }
27332745
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/Label.xml' path='docs/members[@name="Label"]/Id/*' />
2734-
public string Id { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
2746+
public string Id { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
27352747
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/Label.xml' path='docs/members[@name="Label"]/Name/*' />
2736-
public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
2748+
public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
27372749
}
27382750
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityRank.xml' path='docs/members[@name="SensitivityRank"]/SensitivityRank/*' />
27392751
public enum SensitivityRank
@@ -2757,11 +2769,11 @@ public partial class SensitivityClassification
27572769
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityClassification.xml' path='docs/members[@name="SensitivityClassification"]/ctor/*' />
27582770
public SensitivityClassification(System.Collections.Generic.IList<Microsoft.Data.SqlClient.DataClassification.Label> labels, System.Collections.Generic.IList<Microsoft.Data.SqlClient.DataClassification.InformationType> informationTypes, System.Collections.Generic.IList<Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity> columnSensitivity, SensitivityRank sensitivityRank) { }
27592771
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityClassification.xml' path='docs/members[@name="SensitivityClassification"]/ColumnSensitivities/*' />
2760-
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity> ColumnSensitivities { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
2772+
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity> ColumnSensitivities { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
27612773
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityClassification.xml' path='docs/members[@name="SensitivityClassification"]/InformationTypes/*' />
2762-
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Data.SqlClient.DataClassification.InformationType> InformationTypes { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
2774+
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Data.SqlClient.DataClassification.InformationType> InformationTypes { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
27632775
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityClassification.xml' path='docs/members[@name="SensitivityClassification"]/Labels/*' />
2764-
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Data.SqlClient.DataClassification.Label> Labels { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
2776+
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Data.SqlClient.DataClassification.Label> Labels { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
27652777
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityClassification.xml' path='docs/members[@name="SensitivityClassification"]/SensitivityRank/*' />
27662778
public SensitivityRank SensitivityRank { get { throw null; } }
27672779
}
@@ -2771,9 +2783,9 @@ public partial class SensitivityProperty
27712783
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityProperty.xml' path='docs/members[@name="SensitivityProperty"]/ctor/*' />
27722784
public SensitivityProperty(Microsoft.Data.SqlClient.DataClassification.Label label, Microsoft.Data.SqlClient.DataClassification.InformationType informationType, SensitivityRank sensitivityRank) { }
27732785
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityProperty.xml' path='docs/members[@name="SensitivityProperty"]/InformationType/*' />
2774-
public Microsoft.Data.SqlClient.DataClassification.InformationType InformationType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
2786+
public Microsoft.Data.SqlClient.DataClassification.InformationType InformationType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
27752787
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityProperty.xml' path='docs/members[@name="SensitivityProperty"]/Label/*' />
2776-
public Microsoft.Data.SqlClient.DataClassification.Label Label { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
2788+
public Microsoft.Data.SqlClient.DataClassification.Label Label { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
27772789
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityProperty.xml' path='docs/members[@name="SensitivityProperty"]/SensitivityRank/*' />
27782790
public SensitivityRank SensitivityRank { get { throw null; } }
27792791
}

src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
4-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net9.0;netstandard2.0</TargetFrameworks>
55
<IntermediateOutputPath>$(ObjFolder)$(Configuration)\$(AssemblyName)\ref\</IntermediateOutputPath>
6+
<TargetGroup Condition="'$([MSBuild]::GetTargetFrameworkIdentifier($(TargetFramework)))'=='.NETCoreApp'">netcoreapp</TargetGroup>
67
<OutputPath>$(BinFolder)$(Configuration)\$(AssemblyName)\ref\</OutputPath>
8+
<!-- When building for library distribution (BuildForLib=true), set the output path to a netstandard-specific directory.
9+
This condition also ensures that netcoreapp builds are excluded from this path adjustment. -->
10+
<OutputPath Condition="'$(BuildForLib)' == 'true' AND '$(TargetGroup)' != 'netcoreapp'">$(BinFolder)$(Configuration).$(Platform)\$(AssemblyName)\netstandard\</OutputPath>
711
<DocumentationFile>$(OutputPath)\$(TargetFramework)\Microsoft.Data.SqlClient.xml</DocumentationFile>
812
<Product>Core $(BaseProduct)</Product>
913
<Configurations>Debug;Release;</Configurations>
10-
<TargetGroup Condition="'$([MSBuild]::GetTargetFrameworkIdentifier($(TargetFramework)))'=='.NETCoreApp'">netcoreapp</TargetGroup>
1114
<Platforms>AnyCPU;x64;x86</Platforms>
1215
</PropertyGroup>
13-
<!--Generating Strong Name-->
14-
<PropertyGroup Condition="$(CDP_BUILD_TYPE)==Official">
16+
<!--Generating Strong Name-->
17+
<PropertyGroup Condition="$(CDP_BUILD_TYPE)==Official">
1518
<SignAssembly>true</SignAssembly>
1619
<KeyFile>$(SigningKeyPath)</KeyFile>
1720
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>
1821
</PropertyGroup>
1922
<PropertyGroup Condition="$(CDP_BUILD_TYPE)!=Official">
2023
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>
2124
</PropertyGroup>
22-
2325
<ItemGroup>
2426
<InternalsVisibleTo Include="UnitTests" />
2527
</ItemGroup>
26-
2728
<ItemGroup>
2829
<Compile Include="Microsoft.Data.SqlClient.cs" />
2930
<Compile Include="Microsoft.Data.SqlClient.Manual.cs" />
31+
</ItemGroup>
32+
<ItemGroup Condition="$(TargetGroup) == 'netcoreapp'">
3033
<Compile Include="..\..\ref\Microsoft.Data.SqlClient.Batch.cs" />
3134
<Compile Include="..\..\ref\Microsoft.Data.SqlClient.Batch.NetCoreApp.cs" />
3235
</ItemGroup>
@@ -42,5 +45,8 @@
4245
<PackageReference Include="Microsoft.Bcl.Cryptography" Version="$(MicrosoftBclCryptographyVersion)" />
4346
</ItemGroup>
4447

45-
<Import Project="$(ToolsDir)targets\TrimDocsForIntelliSense.targets" />
48+
<Import Project="$(ToolsDir)targets\ResolveContract.targets" Condition="'$(OSGroup)' == 'AnyOS' AND '$(TargetGroup)' != 'netcoreapp'" />
49+
<Import Project="$(ToolsDir)targets\NotSupported.targets" Condition="'$(OSGroup)' == 'AnyOS' AND '$(TargetGroup)' != 'netcoreapp'" />
50+
<!-- Trim docs for intellisense for ref folder (netcore/netstandard) but not when building for lib folder (only netstandard is built for lib from here) -->
51+
<Import Project="$(ToolsDir)targets\TrimDocsForIntelliSense.targets" Condition="'$(BuildForLib)' != 'true' OR '$(TargetGroup)' == 'netcoreapp'" />
4652
</Project>

0 commit comments

Comments
 (0)