Skip to content

Commit f8bb3c3

Browse files
committed
fix
1 parent ef41af2 commit f8bb3c3

44 files changed

Lines changed: 17 additions & 18980 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,5 @@
158158
/切面编程/AOP/ClassLibrary1/obj
159159
/Dapper_Demo/DapperDemo/DapperDemo/appsettings.json
160160
/Dapper_Demo/DapperDemo/.vs
161+
/Dapper_Demo/DapperDemo/DapperDemo/obj
162+
/Dapper_Demo/DapperDemo/DapperDemo/bin

Dapper_Demo/DapperDemo/DapperDemo/DBContext.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public void CommitTransaction()
6262
{
6363
DbTransaction?.Commit();
6464
Committed = true;
65+
66+
Dispose();
6567
}
6668

6769
/// <summary>
@@ -71,6 +73,19 @@ public void RollBackTransaction()
7173
{
7274
DbTransaction?.Rollback();
7375
Committed = true;
76+
77+
Dispose();
78+
}
79+
80+
/// <summary>
81+
/// 释放
82+
/// </summary>
83+
public void Dispose()
84+
{
85+
DbTransaction?.Dispose();
86+
if (DbConnection.State == ConnectionState.Open)
87+
_dbConnection?.Close();
88+
_dbConnection?.Dispose();
7489
}
7590
}
7691
}
Binary file not shown.
Binary file not shown.

Dapper_Demo/DapperDemo/DapperDemo/bin/Debug/netcoreapp2.1/DapperDemo.deps.json

Lines changed: 0 additions & 5389 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.

Dapper_Demo/DapperDemo/DapperDemo/bin/Debug/netcoreapp2.1/DapperDemo.runtimeconfig.dev.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

Dapper_Demo/DapperDemo/DapperDemo/bin/Debug/netcoreapp2.1/DapperDemo.runtimeconfig.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

Dapper_Demo/DapperDemo/DapperDemo/obj/DapperDemo.csproj.nuget.cache

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)