public static DBCConn GetInstance() { if (_instance == null) { _instance = new DBCConn(); } return(_instance); }
static void Main(string[] args) { DBCConn connection = DBCConn.GetInstance(); connection.Name = "Sample Instance"; var connection1 = DBCConn.GetInstance(); //DBCConn connection2 = new DBCConn(); Console.WriteLine($"Instance Name of connection 0 : {connection.Name} "); Console.WriteLine($"Instance Name of connection 1 : {connection1.Name} "); Console.Read(); }