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 InsertAsync(string tableName, string primaryKeyName, object poco) => throw new NotImplementedException(); public object Insert(string tableName, string primaryKeyName, bool autoIncrement, T poco) => throw new NotImplementedException(); public object Insert(string tableName, string primaryKeyName, T poco) => throw new NotImplementedException(); public object Insert(T poco) => throw new NotImplementedException(); + public void InsertBulk(IEnumerable pocos, InsertBulkOptions? options = null) => throw new NotImplementedException(); public Task InsertAsync(T poco) => throw new NotImplementedException(); + public Task InsertBulkAsync(IEnumerable pocos, InsertBulkOptions options = null) => throw new NotImplementedException(); public Task InsertBatchAsync(IEnumerable pocos, BatchOptions options = null) => throw new NotImplementedException(); @@ -206,6 +211,9 @@ namespace Umbraco.Cms.Tests.Common.TestHelpers public IAsyncUpdateQueryProvider UpdateManyAsync() => throw new NotImplementedException(); public IAsyncDeleteQueryProvider DeleteManyAsync() => throw new NotImplementedException(); + public Task IsNewAsync(T poco) => throw new NotImplementedException(); + + public Task SaveAsync(T poco) => throw new NotImplementedException(); public void InsertBulk(IEnumerable pocos) => throw new NotImplementedException(); @@ -350,6 +358,15 @@ namespace Umbraco.Cms.Tests.Common.TestHelpers public TRet FetchMultiple(Func, List, List, TRet> cb, Sql sql) => throw new NotImplementedException(); public TRet FetchMultiple(Func, List, List, List, TRet> cb, Sql sql) => throw new NotImplementedException(); + (List, List) IDatabaseQuery.FetchMultiple(string sql, params object[] args) => throw new NotImplementedException(); + + (List, List, List) IDatabaseQuery.FetchMultiple(string sql, params object[] args) => throw new NotImplementedException(); + + (List, List, List, List) IDatabaseQuery.FetchMultiple(string sql, params object[] args) => throw new NotImplementedException(); + + (List, List) IDatabaseQuery.FetchMultiple(Sql sql) => throw new NotImplementedException(); + + (List, List, List) IDatabaseQuery.FetchMultiple(Sql sql) => throw new NotImplementedException(); public Tuple, List> FetchMultiple(string sql, params object[] args) => throw new NotImplementedException(); @@ -382,6 +399,9 @@ namespace Umbraco.Cms.Tests.Common.TestHelpers public Task FirstOrDefaultAsync(string sql, params object[] args) => throw new NotImplementedException(); public Task FirstOrDefaultAsync(Sql sql) => throw new NotImplementedException(); + IAsyncEnumerable IAsyncQueryDatabase.QueryAsync(string sql, params object[] args) => throw new NotImplementedException(); + + IAsyncEnumerable IAsyncQueryDatabase.QueryAsync(Sql sql) => throw new NotImplementedException(); public Task> QueryAsync(string sql, params object[] args) => throw new NotImplementedException(); @@ -406,6 +426,29 @@ namespace Umbraco.Cms.Tests.Common.TestHelpers public Task> SkipTakeAsync(long skip, long take, string sql, params object[] args) => throw new NotImplementedException(); public Task> SkipTakeAsync(long skip, long take, Sql sql) => throw new NotImplementedException(); + public Task FetchMultipleAsync(Func, List, TRet> cb, string sql, params object[] args) => throw new NotImplementedException(); + + public Task FetchMultipleAsync(Func, List, List, TRet> cb, string sql, params object[] args) => throw new NotImplementedException(); + + public Task FetchMultipleAsync(Func, List, List, List, TRet> cb, string sql, params object[] args) => throw new NotImplementedException(); + + public Task FetchMultipleAsync(Func, List, TRet> cb, Sql sql) => throw new NotImplementedException(); + + public Task FetchMultipleAsync(Func, List, List, TRet> cb, Sql sql) => throw new NotImplementedException(); + + public Task FetchMultipleAsync(Func, List, List, List, TRet> cb, Sql sql) => throw new NotImplementedException(); + + public Task<(List, List)> FetchMultipleAsync(string sql, params object[] args) => throw new NotImplementedException(); + + public Task<(List, List, List)> FetchMultipleAsync(string sql, params object[] args) => throw new NotImplementedException(); + + public Task<(List, List, List, List)> FetchMultipleAsync(string sql, params object[] args) => throw new NotImplementedException(); + + public Task<(List, List)> FetchMultipleAsync(Sql sql) => throw new NotImplementedException(); + + public Task<(List, List, List)> FetchMultipleAsync(Sql sql) => throw new NotImplementedException(); + + public Task<(List, List, List, List)> FetchMultipleAsync(Sql sql) => throw new NotImplementedException(); public void BuildPageQueries(long skip, long take, string sql, ref object[] args, out string sqlCount, out string sqlPage) => throw new NotImplementedException(); } diff --git a/tests/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj b/tests/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj index e8472258bd..2c05ea6bf9 100644 --- a/tests/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj +++ b/tests/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj @@ -17,7 +17,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/tests/Umbraco.Tests.Integration/Testing/BaseTestDatabase.cs b/tests/Umbraco.Tests.Integration/Testing/BaseTestDatabase.cs index 564c45d5ad..47d81e3c11 100644 --- a/tests/Umbraco.Tests.Integration/Testing/BaseTestDatabase.cs +++ b/tests/Umbraco.Tests.Integration/Testing/BaseTestDatabase.cs @@ -5,10 +5,10 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Data; -using System.Data.SqlClient; using System.Diagnostics; using System.Linq; using System.Threading; +using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; using Moq; using Umbraco.Cms.Core; diff --git a/tests/Umbraco.Tests.Integration/Testing/SqlDeveloperTestDatabase.cs b/tests/Umbraco.Tests.Integration/Testing/SqlDeveloperTestDatabase.cs index b35b6ac0d5..9daa55a1cb 100644 --- a/tests/Umbraco.Tests.Integration/Testing/SqlDeveloperTestDatabase.cs +++ b/tests/Umbraco.Tests.Integration/Testing/SqlDeveloperTestDatabase.cs @@ -3,10 +3,10 @@ using System; using System.Collections.Concurrent; -using System.Data.SqlClient; using System.Linq; using System.Threading; using System.Threading.Tasks; +using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; using Umbraco.Cms.Infrastructure.Persistence; diff --git a/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs b/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs index fb505e6b83..ccccb28a9d 100644 --- a/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs +++ b/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs @@ -4,11 +4,11 @@ using System; using System.Collections.Generic; using System.Data.Common; -using System.Data.SqlClient; using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.Data.SqlClient; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs index 96ded92f41..51af43a0e8 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs @@ -1,14 +1,13 @@ using System; using System.Collections.Generic; -using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using Microsoft.Data.SqlClient; using NPoco; using NUnit.Framework; using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Scoping; using Umbraco.Cms.Infrastructure.Persistence.Dtos; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MacroRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MacroRepositoryTest.cs index 2766e66426..1b1c7cdc9f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MacroRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MacroRepositoryTest.cs @@ -2,8 +2,8 @@ // See LICENSE for more details. using System.Collections.Generic; -using System.Data.SqlClient; using System.Linq; +using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; using NUnit.Framework; using Umbraco.Cms.Core.Cache; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ServerRegistrationRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ServerRegistrationRepositoryTest.cs index f85796f622..7fd582008d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ServerRegistrationRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ServerRegistrationRepositoryTest.cs @@ -3,8 +3,8 @@ using System; using System.Collections.Generic; -using System.Data.SqlClient; using System.Linq; +using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; using NUnit.Framework; using Umbraco.Cms.Core.Cache; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj index 41d540302b..6070f468b1 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj +++ b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj @@ -95,7 +95,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/tests/Umbraco.Tests.UnitTests/TestHelpers/BaseUsingSqlSyntax.cs b/tests/Umbraco.Tests.UnitTests/TestHelpers/BaseUsingSqlSyntax.cs index 023c9ad952..ca7950a7cf 100644 --- a/tests/Umbraco.Tests.UnitTests/TestHelpers/BaseUsingSqlSyntax.cs +++ b/tests/Umbraco.Tests.UnitTests/TestHelpers/BaseUsingSqlSyntax.cs @@ -45,7 +45,7 @@ namespace Umbraco.Cms.Tests.UnitTests.TestHelpers { new NullableDateMapper() }; - var pocoDataFactory = new FluentPocoDataFactory((type, iPocoDataFactory) => new PocoDataBuilder(type, pocoMappers).Init()); + var pocoDataFactory = new FluentPocoDataFactory((type, iPocoDataFactory) => new PocoDataBuilder(type, pocoMappers).Init(), pocoMappers); var sqlSyntax = new SqlServerSyntaxProvider(Options.Create(new GlobalSettings())); SqlContext = new SqlContext(sqlSyntax, DatabaseType.SqlServer2012, pocoDataFactory, factory.GetRequiredService()); Mappers = factory.GetRequiredService(); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeHelperTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeHelperTests.cs index b2fade7e36..29c583dc75 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeHelperTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeHelperTests.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data.Odbc; using System.Data.OleDb; -using System.Data.SqlClient; using System.Linq; using System.Reflection; +using Microsoft.Data.SqlClient; using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Composing; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/BulkDataReaderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/BulkDataReaderTests.cs index 8508281444..8ecf6870a4 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/BulkDataReaderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/BulkDataReaderTests.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Data; using System.Data.Common; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; using NUnit.Framework; using Umbraco.Cms.Infrastructure.Persistence; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTemplateTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTemplateTests.cs index ac880c2b3b..3eddb0fe29 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTemplateTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTemplateTests.cs @@ -42,7 +42,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Infrastructure.Persistence.NPocoTe public void SqlTemplateArgs() { var mappers = new NPoco.MapperCollection { new NullableDateMapper() }; - var factory = new FluentPocoDataFactory((type, iPocoDataFactory) => new PocoDataBuilder(type, mappers).Init()); + var factory = new FluentPocoDataFactory((type, iPocoDataFactory) => new PocoDataBuilder(type, mappers).Init(), mappers); var sqlContext = new SqlContext(new SqlServerSyntaxProvider(Options.Create(new GlobalSettings())), DatabaseType.SQLCe, factory); var sqlTemplates = new SqlTemplates(sqlContext);