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