Synchronization code

This commit is contained in:
sunkaixuan 2023-02-15 16:16:59 +08:00
parent fcfc86e2ee
commit e9fe84d1e5
6 changed files with 31 additions and 2 deletions

View File

@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace SqlSugar namespace SqlSugar
{ {
@ -19,5 +20,12 @@ namespace SqlSugar
var result= inertable.GetType().GetMethod("ExecuteCommand").Invoke(inertable,new object[] { }); var result= inertable.GetType().GetMethod("ExecuteCommand").Invoke(inertable,new object[] { });
return (int)result; return (int)result;
} }
public async Task<int> ExecuteCommandAsync()
{
if (Context == null) return 0;
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
var result = inertable.GetType().GetMethod("ExecuteCommandAsync").Invoke(inertable, new object[] { });
return await(Task<int>)result;
}
} }
} }

View File

@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace SqlSugar namespace SqlSugar
{ {
@ -19,5 +20,12 @@ namespace SqlSugar
var result= inertable.GetType().GetMethod("ExecuteCommand").Invoke(inertable,new object[] { }); var result= inertable.GetType().GetMethod("ExecuteCommand").Invoke(inertable,new object[] { });
return (int)result; return (int)result;
} }
public async Task<int> ExecuteCommandAsync()
{
if (Context == null) return 0;
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
var result = inertable.GetType().GetMethod("ExecuteCommandAsync").Invoke(inertable, new object[] { });
return await (Task<int>)result;
}
} }
} }

View File

@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace SqlSugar namespace SqlSugar
{ {
@ -19,5 +20,13 @@ namespace SqlSugar
var result= inertable.GetType().GetMethod("ExecuteCommand").Invoke(inertable,new object[] { }); var result= inertable.GetType().GetMethod("ExecuteCommand").Invoke(inertable,new object[] { });
return (int)result; return (int)result;
} }
public async Task<int> ExecuteCommandAsync()
{
if (Context == null) return 0;
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
var result = inertable.GetType().GetMethod("ExecuteCommandAsync").Invoke(inertable, new object[] { });
return await (Task<int>)result;
}
} }
} }

View File

@ -172,6 +172,10 @@ namespace SqlSugar
this.DbType = System.Data.DbType.Date; this.DbType = System.Data.DbType.Date;
this.Value = UtilMethods.DateOnlyToDateTime(this.Value); this.Value = UtilMethods.DateOnlyToDateTime(this.Value);
} }
else if (type?.FullName == "Newtonsoft.Json.Linq.JObject" || type?.FullName == "Newtonsoft.Json.Linq.JArray" || type?.FullName == "Newtonsoft.Json.Linq.JValue")
{
this.Value =this.Value==null?default(string):this.Value.ObjToString() ;
}
} }
public SugarParameter(string name, object value, bool isOutput) public SugarParameter(string name, object value, bool isOutput)

View File

@ -2,7 +2,7 @@
<package > <package >
<metadata> <metadata>
<id>SqlSugarCore</id> <id>SqlSugarCore</id>
<version>5.1.3.50</version> <version>5.1.3.51-preview05</version>
<authors>sunkaixuan</authors> <authors>sunkaixuan</authors>
<owners>果糖大数据科技</owners> <owners>果糖大数据科技</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl> <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>

View File

@ -2,7 +2,7 @@
<package > <package >
<metadata> <metadata>
<id>SqlSugarCoreNoDrive</id> <id>SqlSugarCoreNoDrive</id>
<version>5.1.3.50</version> <version>5.1.3.51-preview05</version>
<authors>sunkaixuan</authors> <authors>sunkaixuan</authors>
<owners>Landa</owners> <owners>Landa</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl> <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>