diff --git a/src/Umbraco.Core/Constants-DatabaseProviders.cs b/src/Umbraco.Core/Constants-DatabaseProviders.cs
index da82746445..1fd16133e5 100644
--- a/src/Umbraco.Core/Constants-DatabaseProviders.cs
+++ b/src/Umbraco.Core/Constants-DatabaseProviders.cs
@@ -5,7 +5,7 @@
public static class DatabaseProviders
{
public const string SqlCe = "System.Data.SqlServerCe.4.0";
- public const string SqlServer = "System.Data.SqlClient";
+ public const string SqlServer = "Microsoft.Data.SqlClient";
}
}
}
diff --git a/src/Umbraco.Core/Persistence/Constants-DbProviderNames.cs b/src/Umbraco.Core/Persistence/Constants-DbProviderNames.cs
index 7c08189d74..bd95776dea 100644
--- a/src/Umbraco.Core/Persistence/Constants-DbProviderNames.cs
+++ b/src/Umbraco.Core/Persistence/Constants-DbProviderNames.cs
@@ -5,7 +5,7 @@ namespace Umbraco.Cms.Core
{
public static class DbProviderNames
{
- public const string SqlServer = "System.Data.SqlClient";
+ public const string SqlServer = "Microsoft.Data.SqlClient";
public const string SqlCe = "System.Data.SqlServerCe.4.0";
}
}
diff --git a/src/Umbraco.Infrastructure/Persistence/BulkDataReader.cs b/src/Umbraco.Infrastructure/Persistence/BulkDataReader.cs
index 61db41a20a..42c3ff1865 100644
--- a/src/Umbraco.Infrastructure/Persistence/BulkDataReader.cs
+++ b/src/Umbraco.Infrastructure/Persistence/BulkDataReader.cs
@@ -1,15 +1,11 @@
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Data.Common;
-using System.Data.SqlClient;
using System.Diagnostics;
using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using Microsoft.Data.SqlClient;
namespace Umbraco.Cms.Infrastructure.Persistence
{
diff --git a/src/Umbraco.Infrastructure/Persistence/FaultHandling/Strategies/NetworkConnectivityErrorDetectionStrategy.cs b/src/Umbraco.Infrastructure/Persistence/FaultHandling/Strategies/NetworkConnectivityErrorDetectionStrategy.cs
index 004ec1f9b2..8cd01e706c 100644
--- a/src/Umbraco.Infrastructure/Persistence/FaultHandling/Strategies/NetworkConnectivityErrorDetectionStrategy.cs
+++ b/src/Umbraco.Infrastructure/Persistence/FaultHandling/Strategies/NetworkConnectivityErrorDetectionStrategy.cs
@@ -1,5 +1,5 @@
using System;
-using System.Data.SqlClient;
+using Microsoft.Data.SqlClient;
namespace Umbraco.Cms.Infrastructure.Persistence.FaultHandling.Strategies
{
diff --git a/src/Umbraco.Infrastructure/Persistence/FaultHandling/Strategies/SqlAzureTransientErrorDetectionStrategy.cs b/src/Umbraco.Infrastructure/Persistence/FaultHandling/Strategies/SqlAzureTransientErrorDetectionStrategy.cs
index 37968c4376..faf6442333 100644
--- a/src/Umbraco.Infrastructure/Persistence/FaultHandling/Strategies/SqlAzureTransientErrorDetectionStrategy.cs
+++ b/src/Umbraco.Infrastructure/Persistence/FaultHandling/Strategies/SqlAzureTransientErrorDetectionStrategy.cs
@@ -1,5 +1,5 @@
using System;
-using System.Data.SqlClient;
+using Microsoft.Data.SqlClient;
namespace Umbraco.Cms.Infrastructure.Persistence.FaultHandling.Strategies
{
@@ -104,7 +104,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.FaultHandling.Strategies
// Resource ID: %d. The %s limit for the database is %d and has been reached.
case 10928:
// SQL Error Code: 10929
- // Resource ID: %d. The %s minimum guarantee is %d, maximum limit is %d and the current usage for the database is %d.
+ // Resource ID: %d. The %s minimum guarantee is %d, maximum limit is %d and the current usage for the database is %d.
// However, the server is currently too busy to support requests greater than %d for this database.
case 10929:
// SQL Error Code: 10053
@@ -112,14 +112,14 @@ namespace Umbraco.Cms.Infrastructure.Persistence.FaultHandling.Strategies
// An established connection was aborted by the software in your host machine.
case 10053:
// SQL Error Code: 10054
- // A transport-level error has occurred when sending the request to the server.
+ // A transport-level error has occurred when sending the request to the server.
// (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
case 10054:
// SQL Error Code: 10060
- // A network-related or instance-specific error occurred while establishing a connection to SQL Server.
- // The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server
- // is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed
- // because the connected party did not properly respond after a period of time, or established connection failed
+ // A network-related or instance-specific error occurred while establishing a connection to SQL Server.
+ // The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server
+ // is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed
+ // because the connected party did not properly respond after a period of time, or established connection failed
// because connected host has failed to respond.)"}
case 10060:
// SQL Error Code: 40197
@@ -129,21 +129,21 @@ namespace Umbraco.Cms.Infrastructure.Persistence.FaultHandling.Strategies
// The service has encountered an error processing your request. Please try again.
case 40540:
// SQL Error Code: 40613
- // Database XXXX on server YYYY is not currently available. Please retry the connection later. If the problem persists, contact customer
+ // Database XXXX on server YYYY is not currently available. Please retry the connection later. If the problem persists, contact customer
// support, and provide them the session tracing ID of ZZZZZ.
case 40613:
// SQL Error Code: 40143
// The service has encountered an error processing your request. Please try again.
case 40143:
// SQL Error Code: 233
- // The client was unable to establish a connection because of an error during connection initialization process before login.
- // Possible causes include the following: the client tried to connect to an unsupported version of SQL Server; the server was too busy
- // to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server.
+ // The client was unable to establish a connection because of an error during connection initialization process before login.
+ // Possible causes include the following: the client tried to connect to an unsupported version of SQL Server; the server was too busy
+ // to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server.
// (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
case 233:
// SQL Error Code: 64
- // A connection was successfully established with the server, but then an error occurred during the login process.
- // (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
+ // A connection was successfully established with the server, but then an error occurred during the login process.
+ // (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
case 64:
// DBNETLIB Error Code: 20
// The instance of SQL Server you attempted to connect to does not support encryption.
diff --git a/src/Umbraco.Infrastructure/Persistence/FaultHandling/ThrottlingCondition.cs b/src/Umbraco.Infrastructure/Persistence/FaultHandling/ThrottlingCondition.cs
index 9155937fe0..96d42a9481 100644
--- a/src/Umbraco.Infrastructure/Persistence/FaultHandling/ThrottlingCondition.cs
+++ b/src/Umbraco.Infrastructure/Persistence/FaultHandling/ThrottlingCondition.cs
@@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
-using System.Data.SqlClient;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
+using Microsoft.Data.SqlClient;
namespace Umbraco.Cms.Infrastructure.Persistence.FaultHandling
{
diff --git a/src/Umbraco.Infrastructure/Persistence/LocalDb.cs b/src/Umbraco.Infrastructure/Persistence/LocalDb.cs
index c51344a342..fe616b56f6 100644
--- a/src/Umbraco.Infrastructure/Persistence/LocalDb.cs
+++ b/src/Umbraco.Infrastructure/Persistence/LocalDb.cs
@@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using System.Data;
-using System.Data.SqlClient;
using System.Diagnostics;
using System.IO;
using System.Linq;
+using Microsoft.Data.SqlClient;
namespace Umbraco.Cms.Infrastructure.Persistence
{
diff --git a/src/Umbraco.Infrastructure/Persistence/NPocoDatabaseExtensions-Bulk.cs b/src/Umbraco.Infrastructure/Persistence/NPocoDatabaseExtensions-Bulk.cs
index f07867cccc..c53076ff18 100644
--- a/src/Umbraco.Infrastructure/Persistence/NPocoDatabaseExtensions-Bulk.cs
+++ b/src/Umbraco.Infrastructure/Persistence/NPocoDatabaseExtensions-Bulk.cs
@@ -2,9 +2,10 @@
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
-using System.Data.SqlClient;
using System.Linq;
+using Microsoft.Data.SqlClient;
using NPoco;
+using NPoco.SqlServer;
using Umbraco.Cms.Core;
using Umbraco.Cms.Infrastructure.Persistence;
diff --git a/src/Umbraco.Infrastructure/Persistence/NPocoDatabaseExtensions.cs b/src/Umbraco.Infrastructure/Persistence/NPocoDatabaseExtensions.cs
index 813eea58ef..0159245bfd 100644
--- a/src/Umbraco.Infrastructure/Persistence/NPocoDatabaseExtensions.cs
+++ b/src/Umbraco.Infrastructure/Persistence/NPocoDatabaseExtensions.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Data;
-using System.Data.SqlClient;
using System.Text.RegularExpressions;
+using Microsoft.Data.SqlClient;
using NPoco;
using StackExchange.Profiling.Data;
using Umbraco.Cms.Infrastructure.Persistence;
diff --git a/src/Umbraco.Infrastructure/Persistence/SqlServerBulkSqlInsertProvider.cs b/src/Umbraco.Infrastructure/Persistence/SqlServerBulkSqlInsertProvider.cs
index d67c97f2c4..ee2689b9e3 100644
--- a/src/Umbraco.Infrastructure/Persistence/SqlServerBulkSqlInsertProvider.cs
+++ b/src/Umbraco.Infrastructure/Persistence/SqlServerBulkSqlInsertProvider.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Data;
-using System.Data.SqlClient;
using System.Linq;
+using Microsoft.Data.SqlClient;
using NPoco;
using Umbraco.Cms.Infrastructure.Persistence.SqlSyntax;
using Umbraco.Extensions;
diff --git a/src/Umbraco.Infrastructure/Persistence/SqlServerDatabaseCreator.cs b/src/Umbraco.Infrastructure/Persistence/SqlServerDatabaseCreator.cs
index e7f5934e78..63aab47047 100644
--- a/src/Umbraco.Infrastructure/Persistence/SqlServerDatabaseCreator.cs
+++ b/src/Umbraco.Infrastructure/Persistence/SqlServerDatabaseCreator.cs
@@ -1,6 +1,6 @@
using System;
-using System.Data.SqlClient;
using System.IO;
+using Microsoft.Data.SqlClient;
using Umbraco.Cms.Core;
namespace Umbraco.Cms.Infrastructure.Persistence
diff --git a/src/Umbraco.Infrastructure/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs b/src/Umbraco.Infrastructure/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs
index 210b3f2d6b..2db603ad1a 100644
--- a/src/Umbraco.Infrastructure/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs
+++ b/src/Umbraco.Infrastructure/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Data;
-using System.Data.SqlClient;
using System.Linq;
+using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using NPoco;
diff --git a/src/Umbraco.Infrastructure/Persistence/UmbracoDatabaseFactory.cs b/src/Umbraco.Infrastructure/Persistence/UmbracoDatabaseFactory.cs
index fd8bdc0269..6093c06a97 100644
--- a/src/Umbraco.Infrastructure/Persistence/UmbracoDatabaseFactory.cs
+++ b/src/Umbraco.Infrastructure/Persistence/UmbracoDatabaseFactory.cs
@@ -292,7 +292,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence
_pocoMappers.AddRange(_dbProviderFactoryCreator.ProviderSpecificMappers(_providerName));
- var factory = new FluentPocoDataFactory(GetPocoDataFactoryResolver);
+ var factory = new FluentPocoDataFactory(GetPocoDataFactoryResolver, _pocoMappers);
_pocoDataFactory = factory;
var config = new FluentConfig(xmappers => factory);
diff --git a/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs b/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs
index 8d1c74b619..133c0d857a 100644
--- a/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs
+++ b/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs
@@ -1,15 +1,14 @@
using System;
using System.Data;
-using System.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using System.Security.Cryptography;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using NPoco;
-using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Hosting;
using Umbraco.Cms.Core.Runtime;
diff --git a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
index 806fe0853d..0a50a7862c 100644
--- a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
+++ b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
@@ -36,7 +36,7 @@
-
+
@@ -49,7 +49,6 @@
-
diff --git a/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs b/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs
index 819076bbb8..172a093c3c 100644
--- a/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs
+++ b/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs
@@ -1,6 +1,5 @@
using System;
using System.Data.Common;
-using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Reflection;
@@ -11,6 +10,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Microsoft.AspNetCore.Mvc.Razor.Compilation;
using Microsoft.AspNetCore.Server.Kestrel.Core;
+using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
diff --git a/tests/Umbraco.Tests.Benchmarks/SqlTemplatesBenchmark.cs b/tests/Umbraco.Tests.Benchmarks/SqlTemplatesBenchmark.cs
index a69b6b8b76..bd0c426fec 100644
--- a/tests/Umbraco.Tests.Benchmarks/SqlTemplatesBenchmark.cs
+++ b/tests/Umbraco.Tests.Benchmarks/SqlTemplatesBenchmark.cs
@@ -33,8 +33,8 @@ namespace Umbraco.Tests.Benchmarks
public SqlTemplatesBenchmark()
{
- var mappers = new NPoco.MapperCollection( );
- var factory = new FluentPocoDataFactory((type, iPocoDataFactory) => new PocoDataBuilder(type, mappers).Init());
+ var mappers = new NPoco.MapperCollection();
+ var factory = new FluentPocoDataFactory((type, iPocoDataFactory) => new PocoDataBuilder(type, mappers).Init(), mappers);
SqlContext = new SqlContext(new SqlServerSyntaxProvider(Options.Create(new GlobalSettings())), DatabaseType.SQLCe, factory);
SqlTemplates = new SqlTemplates(SqlContext);
diff --git a/tests/Umbraco.Tests.Common/TestHelpers/TestDatabase.cs b/tests/Umbraco.Tests.Common/TestHelpers/TestDatabase.cs
index 188c515bf0..1eec4f5ae7 100644
--- a/tests/Umbraco.Tests.Common/TestHelpers/TestDatabase.cs
+++ b/tests/Umbraco.Tests.Common/TestHelpers/TestDatabase.cs
@@ -86,6 +86,8 @@ namespace Umbraco.Cms.Tests.Common.TestHelpers
{
}
+ (List, List, List, List) IDatabaseQuery.FetchMultiple(Sql sql) => throw new NotImplementedException();
+
public int OneTimeCommandTimeout { get; set; }
public MapperCollection Mappers { get; set; }
@@ -182,14 +184,17 @@ namespace Umbraco.Cms.Tests.Common.TestHelpers
public Task ExecuteAsync(string sql, params object[] args) => throw new NotImplementedException();
public Task ExecuteAsync(Sql sql) => throw new NotImplementedException();
+ public Task