This commit is contained in:
sunkaixuan 2022-04-09 14:18:41 +08:00
parent ccaf62ba87
commit d6d96076cb
4 changed files with 18 additions and 4 deletions

View File

@ -106,7 +106,10 @@ namespace SqlSugar
} }
if (sqlParameter.DbType == System.Data.DbType.Guid) { if (sqlParameter.DbType == System.Data.DbType.Guid) {
sqlParameter.DbType = System.Data.DbType.String; sqlParameter.DbType = System.Data.DbType.String;
sqlParameter.Value = sqlParameter.Value.ObjToString(); if (sqlParameter.Value != DBNull.Value)
{
sqlParameter.Value = sqlParameter.Value.ObjToString();
}
} }
if (isVarchar && sqlParameter.DbType == System.Data.DbType.String) if (isVarchar && sqlParameter.DbType == System.Data.DbType.String)
{ {

View File

@ -2,7 +2,7 @@
<package > <package >
<metadata> <metadata>
<id>SqlSugarCore</id> <id>SqlSugarCore</id>
<version>5.0.6.4</version> <version>5.0.6.5</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.0.6.4</version> <version>5.0.6.5</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>

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using SqlSugar;
namespace OrmTest namespace OrmTest
{ {
public partial class NewUnitTest public partial class NewUnitTest
@ -13,6 +13,17 @@ namespace OrmTest
if (Db.DbMaintenance.IsAnyTable("UnitCodeTest1", false)) if (Db.DbMaintenance.IsAnyTable("UnitCodeTest1", false))
Db.DbMaintenance.DropTable("UnitCodeTest1"); Db.DbMaintenance.DropTable("UnitCodeTest1");
Db.CodeFirst.InitTables<UnitCodeTest1>(); Db.CodeFirst.InitTables<UnitCodeTest1>();
Db.CodeFirst.InitTables<Test00111>();
Db.DbMaintenance.TruncateTable<Test00111>();
Db.Insertable(new Test00111()).ExecuteCommand();
var list = Db.Queryable<Test00111>().ToList();
}
public class Test00111
{
public int id { get; set; }
[SugarColumn(ColumnDataType = "guid",IsNullable =true)]
public Guid? creater { get; set; }
} }
public class UnitCodeTest1 public class UnitCodeTest1
{ {