Skip to content

Use Microsoft.EntityFramework.SqlServer with the modern SqlClient #10424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<PackageVersion Include="CommonMark.NET" Version="0.15.1" />
<PackageVersion Include="CsvHelper" Version="7.1.1" />
<PackageVersion Include="d3" Version="5.4.0" />
<PackageVersion Include="Dapper.StrongName" Version="1.50.2" />
<PackageVersion Include="Dapper.StrongName" Version="2.1.66" />
<PackageVersion Include="dotNetRDF" Version="1.0.8.3533" />
<PackageVersion Include="EntityFramework" Version="6.5.1" />
<PackageVersion Include="FluentAssertions" Version="5.5.0" />
Expand Down Expand Up @@ -63,6 +63,8 @@
<PackageVersion Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="3.6.0" />
<PackageVersion Include="Microsoft.Data.Services.Client" Version="5.8.4" />
<PackageVersion Include="Microsoft.Data.Services" Version="5.8.4" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.6" />
<PackageVersion Include="Microsoft.EntityFramework.SqlServer" Version="6.5.1" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
Expand Down Expand Up @@ -134,7 +136,6 @@
<PackageVersion Include="Strathweb.CacheOutput.WebApi2.StrongName" Version="0.9.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.ComponentModel.EventBasedAsync" Version="4.0.11" />
<PackageVersion Include="System.Data.SqlClient" Version="4.8.6" />
<PackageVersion Include="System.Diagnostics.Debug" Version="4.3.0" />
<PackageVersion Include="System.Drawing.Common" Version="9.0.0" />
<PackageVersion Include="System.Formats.Asn1" Version="8.0.2" />
Expand Down
2 changes: 1 addition & 1 deletion src/ArchivePackages/ArchivePackages.Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using Dapper;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
Expand Down
6 changes: 3 additions & 3 deletions src/Catalog/Helpers/GalleryDatabaseQueryService.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using NuGet.Services.Sql;

namespace NuGet.Services.Metadata.Catalog.Helpers
Expand Down Expand Up @@ -289,4 +289,4 @@ private async Task<IReadOnlyCollection<FeedPackageDetails>> ReadPackagesAsync(Sq
return packages;
}
}
}
}
2 changes: 1 addition & 1 deletion src/DatabaseMigrationTools/DatabaseMigrationTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Description>Database migration tools for NuGet Gallery/Support Requests/Validation databases</Description>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EntityFramework" />
<PackageReference Include="Microsoft.EntityFramework.SqlServer" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NuGet.Services.DatabaseMigration\NuGet.Services.DatabaseMigration.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions src/DatabaseMigrationTools/GalleryDbMigrationContext.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Data.Entity.Migrations;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using NuGet.Services.DatabaseMigration;
using NuGetGallery.Migrations;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Data.Entity.Migrations;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using NuGet.Services.DatabaseMigration;
using NuGetGallery.Areas.Admin;
using NuGetGallery.Areas.Admin.Models;
Expand Down
6 changes: 3 additions & 3 deletions src/DatabaseMigrationTools/ValidationDbMigrationContext.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Data.Entity.Migrations;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using NuGet.Services.DatabaseMigration;
using NuGet.Services.Validation;

Expand All @@ -26,4 +26,4 @@ public ValidationDbMigrationContext(SqlConnection sqlConnection)
GetDbMigrator = () => new DbMigrator(migrationsConfiguration, new ValidationEntitiesContext(SqlConnection));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
using Gallery.CredentialExpiration.Models;
using Microsoft.Data.SqlClient;
using NuGet.Jobs.Configuration;

namespace Gallery.CredentialExpiration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
using Gallery.Maintenance.Models;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Logging;
using NuGet.Jobs.Configuration;

Expand Down
4 changes: 2 additions & 2 deletions src/GalleryTools/Commands/BackfillCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Autofac;
Expand All @@ -13,7 +13,6 @@
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
Expand All @@ -23,6 +22,7 @@
using System.Xml;
using System.Xml.Linq;
using GalleryTools.Utils;
using Microsoft.Data.SqlClient;
using NuGet.Services.Sql;
using NuGet.Packaging.Core;
using NuGet.Versioning;
Expand Down
4 changes: 2 additions & 2 deletions src/GalleryTools/Commands/UpdateIsLatestCommand.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.CommandLineUtils;
using NuGet.Services.Entities;
using NuGetGallery;
Expand Down
4 changes: 2 additions & 2 deletions src/NuGet.Jobs.Common/DelegateSqlConnectionFactory.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Data.SqlClient;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Logging;
using NuGet.Jobs.Configuration;

Expand Down
8 changes: 5 additions & 3 deletions src/NuGet.Jobs.Common/Extensions/DapperExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Data;
using System.Threading.Tasks;
using Dapper;
using NuGet.Jobs;

// ReSharper disable once CheckNamespace
namespace System.Data.SqlClient
namespace Microsoft.Data.SqlClient
{
public static class DapperExtensions
{
Expand Down Expand Up @@ -49,4 +51,4 @@ public static Task<T> ExecuteScalarWithRetryAsync<T>(
maxRetries);
}
}
}
}
4 changes: 2 additions & 2 deletions src/NuGet.Jobs.Common/ISqlConnectionFactory.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Threading.Tasks;
using NuGet.Jobs.Configuration;

Expand Down
4 changes: 2 additions & 2 deletions src/NuGet.Jobs.Common/JobBase.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Data.SqlClient;
using System.Diagnostics.Tracing;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
Expand Down
2 changes: 1 addition & 1 deletion src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Include="Dapper.StrongName" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />
<PackageReference Include="System.Data.SqlClient" />
<PackageReference Include="Microsoft.Data.SqlClient" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
Expand Down
4 changes: 2 additions & 2 deletions src/NuGet.Jobs.Common/SqlRetryUtility.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;

namespace NuGet.Jobs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Logging;
using NuGet.Jobs;
using NuGet.Jobs.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Data;
using System.Data.Entity.Migrations;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

namespace NuGet.Services.DatabaseMigration
{
Expand Down
4 changes: 2 additions & 2 deletions src/NuGet.Services.DatabaseMigration/IMigrationContext.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Data.Entity.Migrations;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

namespace NuGet.Services.DatabaseMigration
{
Expand Down
4 changes: 2 additions & 2 deletions src/NuGet.Services.DatabaseMigration/Job.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Linq;
using System.Data.SqlClient;
using System.Threading.Tasks;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.ComponentModel.Design;
using System.Collections.Generic;
using Autofac;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<Description>Core support library for NuGet database migration</Description>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EntityFramework" />
<PackageReference Include="System.Data.SqlClient" />
<PackageReference Include="Microsoft.EntityFramework.SqlServer" />
<PackageReference Include="Microsoft.Data.SqlClient" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NuGet.Jobs.Common\NuGet.Jobs.Common.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

namespace NuGet.Services.Entities
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="NuGet.Frameworks" />
<PackageReference Include="System.ComponentModel.Annotations" />
<!-- This was lifted to a top-level dependency to resolve a Component Governance alert. -->
<PackageReference Include="System.Data.SqlClient" />
<PackageReference Include="Microsoft.Data.SqlClient" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Logging;
using NuGet.Jobs;
using NuGet.Jobs.Configuration;
Expand Down
4 changes: 2 additions & 2 deletions src/NuGet.Services.Sql/AzureSqlConnectionFactory.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Data.SqlClient;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Logging;
using NuGet.Services.KeyVault;

Expand Down
4 changes: 2 additions & 2 deletions src/NuGet.Services.Sql/AzureSqlConnectionStringBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.ComponentModel;
using System.Data.Common;
using System.Data.SqlClient;
using System.Globalization;
using Microsoft.Data.SqlClient;

namespace NuGet.Services.Sql
{
Expand Down
Loading