Synchronization code

This commit is contained in:
sunkaixuan 2023-10-10 14:58:55 +08:00
parent e4a9a88259
commit d9720b1242
2 changed files with 12 additions and 0 deletions

View File

@ -367,11 +367,21 @@ namespace SqlSugar
After(sql, result);
return result;
}
public T ExecuteReturnEntity(bool isIncludesAllFirstLayer)
{
var data = ExecuteReturnEntity();
return this.Context.Queryable<T>().WhereClassByPrimaryKey(data).IncludesAllFirstLayer().First();
}
public async Task<T> ExecuteReturnEntityAsync()
{
await ExecuteCommandIdentityIntoEntityAsync();
return InsertObjs.First();
}
public async Task<T> ExecuteReturnEntityAsync(bool isIncludesAllFirstLayer)
{
var data=await ExecuteReturnEntityAsync();
return await this.Context.Queryable<T>().WhereClassByPrimaryKey(data).IncludesAllFirstLayer().FirstAsync();
}
public async Task<bool> ExecuteCommandIdentityIntoEntityAsync()
{
var result = InsertObjs.First();

View File

@ -26,7 +26,9 @@ namespace SqlSugar
Task<int> ExecuteReturnIdentityAsync();
Task<int> ExecuteReturnIdentityAsync(CancellationToken token);
T ExecuteReturnEntity();
T ExecuteReturnEntity(bool isIncludesAllFirstLayer);
Task<T> ExecuteReturnEntityAsync();
Task<T> ExecuteReturnEntityAsync(bool isIncludesAllFirstLayer);
bool ExecuteCommandIdentityIntoEntity();
Task<bool> ExecuteCommandIdentityIntoEntityAsync();
long ExecuteReturnBigIdentity();