/// <summary> /// Closes an existing connection. /// </summary> public static void CloseConnection() { if (Instance != null) { Instance.Dispose(); instance = null; } }
/// <summary> /// Opens the connection to use for the database. /// </summary> /// <param name="connectionString">The connection string about the database.</param> /// <returns>True, if the connection is opened, otherwise false.</returns> public static bool OpenConnection(string connectionString) { lock (lockObject) { CloseConnection(); instance = new BizContext(connectionString); } return(true); }