Update InsertByObject UpdateByObject DeleteByObject

This commit is contained in:
sunkaixuan
2023-04-19 19:55:22 +08:00
parent 5ab41ef8d5
commit 5a0f9d0674
4 changed files with 59 additions and 0 deletions

View File

@@ -27,5 +27,16 @@ 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 SplitTable()
{
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
var newMethod = inertable.GetType().GetMyMethod("SplitTable", 0);
var result = newMethod.Invoke(inertable, new object[] { });
return new CommonMethodInfo()
{
Context = result
};
}
} }
} }

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace SqlSugar
{
public class CommonMethodInfo
{
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;
}
}
}

View File

@@ -41,5 +41,15 @@ namespace SqlSugar
var result = inertable.GetType().GetMyMethod("ExecuteReturnIdentityAsync",0).Invoke(inertable, new object[] { }); var result = inertable.GetType().GetMyMethod("ExecuteReturnIdentityAsync",0).Invoke(inertable, new object[] { });
return await (Task<int>)result; return await (Task<int>)result;
} }
public CommonMethodInfo SplitTable()
{
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
var newMethod = inertable.GetType().GetMyMethod("SplitTable", 0);
var result = newMethod.Invoke(inertable, new object[] { });
return new CommonMethodInfo()
{
Context = result
};
}
} }
} }

View File

@@ -28,5 +28,16 @@ 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 SplitTable()
{
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
var newMethod = inertable.GetType().GetMyMethod("SplitTable", 0);
var result = newMethod.Invoke(inertable, new object[] { });
return new CommonMethodInfo()
{
Context = result
};
}
} }
} }