File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/QueryPlanVisualizer/Helpers Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11using System ;
2+ using System . Data ;
23using System . Data . Common ;
34using System . Data . Entity . Infrastructure ;
45using System . Data . Linq ;
@@ -56,7 +57,7 @@ private static DatabaseHelper CreateEntityFrameworkDatabaseHelper<T>(IQueryable<
5657 System . Data . Objects . ObjectQuery < T > ;
5758
5859 if ( objectQuery != null )
59- //EF5 uses ObjectQuery from System.Data.Objects namespace, EF6 uses System.Data.Entity.Core.Objects so it will be null
60+ //EF5 uses ObjectQuery from System.Data.Objects namespace, EF6 uses System.Data.Entity.Core.Objects so it will be null
6061 {
6162 return new EntityFramework5DatabaseHelper ( objectQuery ) ;
6263 }
@@ -84,7 +85,10 @@ public virtual string GetSqlServerQueryExecutionPlan<T>(IQueryable<T> queryable)
8485 {
8586 try
8687 {
87- Connection . Open ( ) ;
88+ if ( Connection . State != ConnectionState . Open )
89+ {
90+ Connection . Open ( ) ;
91+ }
8892
8993 using ( var setStatisticsCommand = Connection . CreateCommand ( ) )
9094 {
You can’t perform that action at this time.
0 commit comments