Browse Source

Update SqlSguarTransaction

pull/8/head
sunkaixuna 3 years ago
parent
commit
d8d75a2b45
  1. 8
      Src/Asp.Net/SqlServerTest/Demo/Demo1_Queryable.cs
  2. 8
      Src/Asp.Net/SqlSugar/Entities/SqlSguarTransaction.cs

8
Src/Asp.Net/SqlServerTest/Demo/Demo1_Queryable.cs

@ -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" });

8
Src/Asp.Net/SqlSugar/Entities/SqlSguarTransaction.cs

@ -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();

Loading…
Cancel
Save