|
@@ -162,6 +162,10 @@ namespace DBHelper
|
|
|
Console.WriteLine(msg);
|
|
Console.WriteLine(msg);
|
|
|
throw new Exception(msg);
|
|
throw new Exception(msg);
|
|
|
}
|
|
}
|
|
|
|
|
+ finally
|
|
|
|
|
+ {
|
|
|
|
|
+ db.Dispose();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -218,8 +222,9 @@ namespace DBHelper
|
|
|
ctx.Dispose();
|
|
ctx.Dispose();
|
|
|
}
|
|
}
|
|
|
Contexts.Clear();
|
|
Contexts.Clear();
|
|
|
- Contexts = null;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public class DB<TContext> where TContext : DbContext
|
|
public class DB<TContext> where TContext : DbContext
|