TimeSpan?=null bug

This commit is contained in:
sunkaixuan 2019-03-29 18:22:00 +08:00
parent 27b64fdf5f
commit 29b005fcc9
2 changed files with 9 additions and 2 deletions

View File

@ -93,7 +93,8 @@ namespace OrmTest.BugTest
BrandId = -1,
UserLevel = 1
}).IgnoreColumns(m => new { m.CreditUpdatetime,m.UserId }).ToSql();
DB.CodeFirst.InitTables(typeof(DataTest));
DB.Insertable(new DataTest()).ExecuteCommand();
}
}
@ -168,5 +169,10 @@ namespace OrmTest.BugTest
public DateTime CreditUpdatetime { get; set; }
#endregion
}
public class DataTest {
[SugarColumn( ColumnDataType = "time",IsNullable =true)]
public TimeSpan? dateTime { get; set; }
}
}

View File

@ -97,7 +97,8 @@ namespace SqlSugar
}
else if (type == UtilConstants.TimeSpanType)
{
this.Value = this.Value.ToString();
if (this.Value != null)
this.Value = this.Value.ToString();
}
}