diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/SqliteProvider.cs b/Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/SqliteProvider.cs index f29bb62bf..953f1ffaf 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/SqliteProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/SqliteProvider.cs @@ -106,7 +106,10 @@ namespace SqlSugar } if (sqlParameter.DbType == System.Data.DbType.Guid) { 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) { diff --git a/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec b/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec index 0abe2c7d1..ff0bcc28e 100644 --- a/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec +++ b/Src/Asp.NetCore2/SqlSugar/SqlSugarForCore.nuspec @@ -2,7 +2,7 @@ SqlSugarCore - 5.0.6.4 + 5.0.6.5 sunkaixuan 果糖大数据科技 http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/Src/Asp.NetCore2/SqlSugar/SqlSugarForCoreNoDrive.nuspec b/Src/Asp.NetCore2/SqlSugar/SqlSugarForCoreNoDrive.nuspec index 0cdbcb42b..ee26a20dd 100644 --- a/Src/Asp.NetCore2/SqlSugar/SqlSugarForCoreNoDrive.nuspec +++ b/Src/Asp.NetCore2/SqlSugar/SqlSugarForCoreNoDrive.nuspec @@ -2,7 +2,7 @@ SqlSugarCoreNoDrive - 5.0.6.4 + 5.0.6.5 sunkaixuan Landa http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/Src/Asp.NetCore2/SqliteTest/UnitTest/UCodeFirst.cs b/Src/Asp.NetCore2/SqliteTest/UnitTest/UCodeFirst.cs index 675a8e69e..80aebe7a7 100644 --- a/Src/Asp.NetCore2/SqliteTest/UnitTest/UCodeFirst.cs +++ b/Src/Asp.NetCore2/SqliteTest/UnitTest/UCodeFirst.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; - +using SqlSugar; namespace OrmTest { public partial class NewUnitTest @@ -13,6 +13,17 @@ namespace OrmTest if (Db.DbMaintenance.IsAnyTable("UnitCodeTest1", false)) Db.DbMaintenance.DropTable("UnitCodeTest1"); Db.CodeFirst.InitTables(); + Db.CodeFirst.InitTables(); + Db.DbMaintenance.TruncateTable(); + Db.Insertable(new Test00111()).ExecuteCommand(); + var list = Db.Queryable().ToList(); + } + + public class Test00111 + { + public int id { get; set; } + [SugarColumn(ColumnDataType = "guid",IsNullable =true)] + public Guid? creater { get; set; } } public class UnitCodeTest1 {