mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 16:18:47 +08:00
Update db.InsertNav
This commit is contained in:
parent
5df2de8e95
commit
ae6865ea53
@ -107,7 +107,33 @@ namespace SqlSugar
|
|||||||
return AsNav().ThenInclude(expression, options);
|
return AsNav().ThenInclude(expression, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Root ExecuteReturnEntity()
|
||||||
|
{
|
||||||
|
var hasTran = this.Context.Ado.Transaction != null;
|
||||||
|
if (hasTran)
|
||||||
|
{
|
||||||
|
return (Root)PreFunc()?._RootList?.FirstOrDefault();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Root result = null;
|
||||||
|
this.Context.Ado.UseTran(() =>
|
||||||
|
{
|
||||||
|
result= (Root)PreFunc()?._RootList?.FirstOrDefault();
|
||||||
|
}, ex => throw ex);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public async Task<Root> ExecuteReturnEntityAsync()
|
||||||
|
{
|
||||||
|
Root result = null;
|
||||||
|
await Task.Run(async () =>
|
||||||
|
{
|
||||||
|
result=ExecuteReturnEntity();
|
||||||
|
await Task.Delay(0);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public bool ExecuteCommand()
|
public bool ExecuteCommand()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user