src/Misc/EFTools/EntityDesign/VisualStudio/VsUtils.cs
// <summary>
//     This will close the DbConnection (or SQLConnection or EntityConnection) safely, Trace and Debug if it can't.
//     It will also call SqlConnection.ClearAllPools to release any read lock if the connection is pointing to a database file.
// </summary>
This will close the DbConnection (or SQLConnection or EntityConnection) safely, Trace and Debug if it can't.
It will also call SqlConnection.ClearAllPools to release any read lock if the connection is pointing to a database file.
This will close the DbConnection ( or SQLConnection or EntityConnection ) safely Trace and Debug if it can ' t . It will also call SqlConnection . ClearAllPools to release any read lock if the connection is pointing to a database file .
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
        internal static void SafeCloseDbConnection(
            DbConnection dbConnection, string designTimeProviderName, string designTimeConnectionString)
        {
            try
            {
                if (null != dbConnection)
                {
                    dbConnection.Close();
                }
            }
            catch
            {
            }
            SafeCloseDbConnectionOnFile(designTimeProviderName, designTimeConnectionString);
        }
[ SuppressMessage ( " " , " " ) ] internal static void SafeCloseDbConnection ( DbConnection dbConnection , string designTimeProviderName , string designTimeConnectionString ) { try { if ( null != dbConnection ) { dbConnection . Close ( ) ; } } catch { } SafeCloseDbConnectionOnFile ( designTimeProviderName , designTimeConnectionString ) ; }
This will close the DbConnection (or SQLConnection or EntityConnection) safely, Trace and Debug if it can't.
This will close the DbConnection ( or SQLConnection or EntityConnection ) safely Trace and Debug if it can ' t .
dbConnection
DbConnection
designTimeProviderName
string
designTimeConnectionString
string