Repository: dotnet/efcore
File: src/EFCore.SqlServer/Storage/Internal/SqlServerConnection.cs (C#)

Code before:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Concurrent;
using System.Runtime.InteropServices;
using Microsoft.Data.SqlClient;

namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal;

/// <summary>
///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
///     the same compatibility standards as public APIs. It may be changed or removed without notice in
///     any release. You should only use it directly in your code with extreme caution and knowing that
///     doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public class SqlServerConnection : RelationalConnection, ISqlServerConnection
{
    // Compensate for slow SQL Server database creation
    private const int DefaultMasterConnectionCommandTimeout = 60;

    private static readonly ConcurrentDictionary<string, bool> MultipleActiveResultSetsEnabledMap = new();

    /// <summary>
    ///     Maps a user-provided connection string to a possibly transformed connection string that will actually be used
    ///     to connect. By default, if the user-provided connection string doesn't set Application Name, we set it to contain
    ///     information about EF Core and the version being used.
    /// </summary>
    private static readonly ConcurrentDictionary<string, string> ConnectionStringMap = new();

    /// <summary>

Review comment (suggestion):
Missing using directive for System.Diagnostics. The code uses FileVersionInfo.GetVersionInfo() on lines 165-166 but doesn't import System.Diagnostics namespace.
```suggestion
using System.Runtime.InteropServices;
using System.Diagnostics;
```

Code after:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Concurrent;
using System.Runtime.InteropServices;
using Microsoft.Data.SqlClient;

namespace Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal;

/// <summary>
///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
///     the same compatibility standards as public APIs. It may be changed or removed without notice in
///     any release. You should only use it directly in your code with extreme caution and knowing that
///     doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public class SqlServerConnection : RelationalConnection, ISqlServerConnection
{
    // Compensate for slow SQL Server database creation
    private const int DefaultMasterConnectionCommandTimeout = 60;

    private static readonly ConcurrentDictionary<string, bool> MultipleActiveResultSetsEnabledMap = new();

    /// <summary>
    ///     Maps a user-provided connection string to a possibly transformed connection string that will actually be used
    ///     to connect. By default, if the user-provided connection string doesn't set Application Name, we set it to contain
    ///     information about EF Core and the version being used.
    /// </summary>
    private static readonly ConcurrentDictionary<string, string> ConnectionStringMap = new();

    private static string? _defaultApplicationName;