mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
Synchronization code
This commit is contained in:
parent
d1a3d4b167
commit
dd339a44fd
@ -27,5 +27,19 @@ namespace SqlSugar
|
||||
var result = inertable.GetType().GetMethod("ExecuteCommandAsync").Invoke(inertable, new object[] { });
|
||||
return await (Task<int>)result;
|
||||
}
|
||||
public int ExecuteReturnIdentity()
|
||||
{
|
||||
if (Context == null) return 0;
|
||||
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
||||
var result = inertable.GetType().GetMethod("ExecuteReturnIdentity").Invoke(inertable, new object[] { });
|
||||
return (int)result;
|
||||
}
|
||||
public async Task<int> ExecuteReturnIdentityAsync()
|
||||
{
|
||||
if (Context == null) return 0;
|
||||
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
||||
var result = inertable.GetType().GetMethod("ExecuteReturnIdentityAsync").Invoke(inertable, new object[] { });
|
||||
return await (Task<int>)result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -398,6 +398,10 @@ namespace SqlSugar
|
||||
|
||||
public Dictionary<string, object> ToDictionary(Expression<Func<T, object>> key, Expression<Func<T, object>> value)
|
||||
{
|
||||
if (this.QueryBuilder.IsSingle() == false && (this.QueryBuilder.AsTables == null||this.QueryBuilder.AsTables.Count==0))
|
||||
{
|
||||
return this.MergeTable().ToDictionary(key,value);
|
||||
}
|
||||
this.QueryBuilder.ResultType = typeof(SugarCacheDictionary);
|
||||
var keyName = QueryBuilder.GetExpressionValue(key, ResolveExpressType.FieldSingle).GetResultString();
|
||||
var valueName = QueryBuilder.GetExpressionValue(value, ResolveExpressType.FieldSingle).GetResultString();
|
||||
|
@ -485,6 +485,10 @@ ParameterT parameter)
|
||||
|
||||
public async Task<Dictionary<string, object>> ToDictionaryAsync(Expression<Func<T, object>> key, Expression<Func<T, object>> value)
|
||||
{
|
||||
if (this.QueryBuilder.IsSingle() == false && (this.QueryBuilder.AsTables == null || this.QueryBuilder.AsTables.Count == 0))
|
||||
{
|
||||
return await this.MergeTable().ToDictionaryAsync(key, value);
|
||||
}
|
||||
this.QueryBuilder.ResultType = typeof(SugarCacheDictionary);
|
||||
var keyName = QueryBuilder.GetExpressionValue(key, ResolveExpressType.FieldSingle).GetResultString();
|
||||
var valueName = QueryBuilder.GetExpressionValue(value, ResolveExpressType.FieldSingle).GetResultString();
|
||||
|
Loading…
Reference in New Issue
Block a user