mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Update SqlSguarTransaction
This commit is contained in:
@@ -27,6 +27,14 @@ namespace OrmTest
|
||||
private static void ConfiQuery()
|
||||
{
|
||||
var db = GetInstance();
|
||||
using (var tran = db.UseTran())
|
||||
{
|
||||
|
||||
|
||||
tran.CommitTran();
|
||||
}
|
||||
|
||||
|
||||
List<DataDictionary> datas = new List<DataDictionary>();
|
||||
datas.Add(new DataDictionary() { Code="1", Name="男",Type="sex" });
|
||||
datas.Add(new DataDictionary() { Code = "2", Name = "女", Type = "sex" });
|
||||
|
@@ -15,6 +15,14 @@ namespace SqlSugar
|
||||
context = client;
|
||||
context.BeginTran();
|
||||
}
|
||||
public void CommitTran()
|
||||
{
|
||||
context.CommitTran();
|
||||
}
|
||||
public void RollbackTran()
|
||||
{
|
||||
context.RollbackTran();
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
context.RollbackTran();
|
||||
|
Reference in New Issue
Block a user