Skip to content

Commit

Permalink
Completing merge of SqlClientFactory changes
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardneal committed May 10, 2024
1 parent 75ffae5 commit 2a0bca3
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,12 @@ internal SqlClientFactory() { }
public override System.Data.Common.DbParameter CreateParameter() { throw null; }
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientFactory.xml' path='docs/members[@name="SqlClientFactory"]/CreateDataSourceEnumerator/*'/>
public override System.Data.Common.DbDataSourceEnumerator CreateDataSourceEnumerator() { throw null; }
#if NET6_0_OR_GREATER
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientFactory.xml' path='docs/members[@name="SqlClientFactory"]/CanCreateBatch/*'/>
public override bool CanCreateBatch { get { throw null; } }
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientFactory.xml' path='docs/members[@name="SqlClientFactory"]/CreateBatch/*'/>
public override System.Data.Common.DbBatch CreateBatch() { throw null; }
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientFactory.xml' path='docs/members[@name="SqlClientFactory"]/CreateBatchCommand/*'/>
public override System.Data.Common.DbBatchCommand CreateBatchCommand() { throw null; }
#endif
}
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientLogger.xml' path='docs/members[@name="SqlClientLogger"]/SqlClientLogger/*'/>
public partial class SqlClientLogger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlClientEventSource.cs">
<Link>Microsoft\Data\SqlClient\SqlClientEventSource.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlClientFactory.cs">
<Link>Microsoft\Data\SqlClient\SqlClientFactory.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlClientLogger.cs">
<Link>Microsoft\Data\SqlClient\SqlClientLogger.cs</Link>
</Compile>
Expand Down Expand Up @@ -646,8 +649,6 @@
<Compile Include="Microsoft\Data\SqlClient\SqlBulkCopy.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlClientDiagnosticListenerExtensions.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlClientEventSource.NetCoreApp.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlClientFactory.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlClientFactory.NetCoreApp.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlColumnEncryptionEnclaveProvider.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlColumnEncryptionEnclaveProvider.NetCoreApp.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionFactory.AssemblyLoadContext.cs" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlClientEventSource.cs">
<Link>Microsoft\Data\SqlClient\SqlClientEventSource.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlClientFactory.cs">
<Link>Microsoft\Data\SqlClient\SqlClientFactory.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlClientLogger.cs">
<Link>Microsoft\Data\SqlClient\SqlClientLogger.cs</Link>
</Compile>
Expand Down Expand Up @@ -668,7 +671,6 @@
<Compile Include="Microsoft\Data\SqlClient\SqlBuffer.netfx.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlBulkCopy.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlCertificateCallbacks.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlClientFactory.netfx.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlClientOriginalAddressInfo.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlClientPermission.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlClientWrapperSmiStream.cs" />
Expand Down Expand Up @@ -766,4 +768,4 @@
<Import Project="$(NetFxSource)tools\targets\GenerateThisAssemblyCs.targets" />
<Import Project="$(NetFxSource)tools\targets\GenerateAssemblyRef.targets" />
<Import Project="$(NetFxSource)tools\targets\GenerateAssemblyInfo.targets" />
</Project>
</Project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
// See the LICENSE file in the project root for more information.

using Microsoft.Data.Sql;
using System;
using System.Data.Common;
using System.Security.Permissions;
using System.Security;
using Microsoft.Data.Common;

namespace Microsoft.Data.SqlClient
{
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientFactory.xml' path='docs/members[@name="SqlClientFactory"]/SqlClientFactory/*'/>
public sealed partial class SqlClientFactory : DbProviderFactory
public sealed class SqlClientFactory : DbProviderFactory
#if NETFRAMEWORK
, IServiceProvider
#endif
{

/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientFactory.xml' path='docs/members[@name="SqlClientFactory"]/Instance/*'/>
Expand Down Expand Up @@ -65,6 +70,21 @@ public override CodeAccessPermission CreatePermission(PermissionState state)
{
return new SqlClientPermission(state);
}

/// <summary>
/// Extension mechanism for additional services; currently the only service
/// supported is the DbProviderServices
/// </summary>
/// <returns>requested service provider or null.</returns>
object IServiceProvider.GetService(Type serviceType)
{
object result = null;
if (serviceType == GreenMethods.SystemDataCommonDbProviderServices_Type)
{
result = GreenMethods.MicrosoftDataSqlClientSqlProviderServices_Instance();
}
return result;
}
#endif

/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientFactory.xml' path='docs/members[@name="SqlClientFactory"]/CreateDataSourceEnumerator/*'/>
Expand Down

0 comments on commit 2a0bca3

Please sign in to comment.