I work on asp.net core 2.2 vs2017 app I face issue I cannot get connection string from start up to static Data access class
class CZConnection public class CZConnection { public string DashboardConnection { get; set; } } StartUp.cs services.Configure<CZConnection>(DBConnection => { DBConnection.DashboardConnection = Configuration.GetConnectionString("DashBoardSQLConnection"); }); public static partial class DataAccess { static SqlConnection InitializeConnection() { return new SqlConnection(here I need to get connection string of DBConnection.DashboardConnection); } return new SqlConnection(); }