Entity Framework/Entity Framework Core connection strings for Windows Forms
When creating a DbContext for Entity Framework 6 or Entity Framework Core by default the constructor for Entity Framework 6 has the name for the connection string and for Entity Framework Core is embedded in OnConfigurating. For personal usage and this is fine while in professional applications there are two considerations, first can someone use the connection string maliciously to gain access to data and secondly, developers should have separate environments for testing. In the following repository there are code samples for encrypting/decrypting connection strings and code samples for working with development, staging and production environments. Each project has a readme file which explains how to implement in a project. Although the majority of code samples are C# using Entity Framework Core there is an example for C# Entity Framework 6 and one example for Entity Framework Core with VB.NET along with unit test. Running code samples Using SSMS (SQL-Server Management Studio), create...