mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 04:35:29 +08:00
Update Db.InsertableByObject
This commit is contained in:
parent
1e2447fadb
commit
5a208ea9d9
@ -35,5 +35,39 @@ namespace SqlSugar
|
|||||||
return await (Task<int>)result;
|
return await (Task<int>)result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public class SplitMethodInfo
|
||||||
|
{
|
||||||
|
internal object Context { get; set; }
|
||||||
|
|
||||||
|
public int ExecuteCommand()
|
||||||
|
{
|
||||||
|
if (Context == null) return 0;
|
||||||
|
var result = Context.GetType().GetMyMethod("ExecuteCommand", 0).Invoke(Context, new object[] { });
|
||||||
|
return (int)result;
|
||||||
|
}
|
||||||
|
public async Task<int> ExecuteCommandAsync()
|
||||||
|
{
|
||||||
|
if (Context == null) return 0;
|
||||||
|
var result = Context.GetType().GetMyMethod("ExecuteCommandAsync", 0).Invoke(Context, new object[] { });
|
||||||
|
return await (Task<int>)result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class UpdateCommonMethodInfo
|
||||||
|
{
|
||||||
|
internal object Context { get; set; }
|
||||||
|
|
||||||
|
public int ExecuteCommand()
|
||||||
|
{
|
||||||
|
if (Context == null) return 0;
|
||||||
|
var result = Context.GetType().GetMyMethod("ExecuteCommand", 0).Invoke(Context, new object[] { });
|
||||||
|
return (int)result;
|
||||||
|
}
|
||||||
|
public async Task<int> ExecuteCommandAsync()
|
||||||
|
{
|
||||||
|
if (Context == null) return 0;
|
||||||
|
var result = Context.GetType().GetMyMethod("ExecuteCommandAsync", 0).Invoke(Context, new object[] { });
|
||||||
|
return await (Task<int>)result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -54,12 +54,12 @@ namespace SqlSugar
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public CommonMethodInfo SplitTable()
|
public SplitMethodInfo SplitTable()
|
||||||
{
|
{
|
||||||
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
||||||
var newMethod = inertable.GetType().GetMyMethod("SplitTable", 0);
|
var newMethod = inertable.GetType().GetMyMethod("SplitTable", 0);
|
||||||
var result = newMethod.Invoke(inertable, new object[] { });
|
var result = newMethod.Invoke(inertable, new object[] { });
|
||||||
return new CommonMethodInfo()
|
return new SplitMethodInfo()
|
||||||
{
|
{
|
||||||
Context = result
|
Context = result
|
||||||
};
|
};
|
||||||
|
@ -29,22 +29,22 @@ namespace SqlSugar
|
|||||||
var result = inertable.GetType().GetMyMethod("ExecuteCommandAsync",0).Invoke(inertable, new object[] { });
|
var result = inertable.GetType().GetMyMethod("ExecuteCommandAsync",0).Invoke(inertable, new object[] { });
|
||||||
return await (Task<int>)result;
|
return await (Task<int>)result;
|
||||||
}
|
}
|
||||||
public CommonMethodInfo IgnoreColumns(params string[] ignoreColumns)
|
public UpdateCommonMethodInfo IgnoreColumns(params string[] ignoreColumns)
|
||||||
{
|
{
|
||||||
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
||||||
var newMethod = inertable.GetType().GetMyMethod("IgnoreColumns", 1,typeof(string[]));
|
var newMethod = inertable.GetType().GetMyMethod("IgnoreColumns", 1,typeof(string[]));
|
||||||
var result = newMethod.Invoke(inertable, new object[] { ignoreColumns });
|
var result = newMethod.Invoke(inertable, new object[] { ignoreColumns });
|
||||||
return new CommonMethodInfo()
|
return new UpdateCommonMethodInfo()
|
||||||
{
|
{
|
||||||
Context = result
|
Context = result
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public CommonMethodInfo SplitTable()
|
public UpdateCommonMethodInfo SplitTable()
|
||||||
{
|
{
|
||||||
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
||||||
var newMethod = inertable.GetType().GetMyMethod("SplitTable", 0);
|
var newMethod = inertable.GetType().GetMyMethod("SplitTable", 0);
|
||||||
var result = newMethod.Invoke(inertable, new object[] { });
|
var result = newMethod.Invoke(inertable, new object[] { });
|
||||||
return new CommonMethodInfo()
|
return new UpdateCommonMethodInfo()
|
||||||
{
|
{
|
||||||
Context = result
|
Context = result
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user