SqlAlias

SqlAlias applies alias definitions from the registry to the server portion of a Microsoft SQL Server connection string


Keywords
License
MIT
Install
Install-Package SqlAlias -Version 2.1.5

Documentation

SqlAlias

Build status

SqlAlias applies alias definitions from the registry to the server portion of a Microsoft SQL Server connection string. Unlike full framework applications, .NET Core apps and websites do not do this by default.

The code is based on user2771704's StackOverflow answer.

Usage

Install the SqlAlias package from NuGet

using SqlAlias;

myConnectionString = Aliases.Map(myConnectionString)

Changes are only made to the connection string if the OS is Windows and if it is running on the .NET Core runtime.