.Select new {} Support for strong null

This commit is contained in:
sunkaixuan 2019-03-29 00:51:02 +08:00
parent 56f1146370
commit 601119514c
2 changed files with 9 additions and 1 deletions

View File

@ -436,6 +436,14 @@ namespace OrmTest.Demo
var test41 = db.Queryable<Student>().Where(it => it.Id==((it.Id==1?2:3)==2?1:2)).ToList();
var test42 = db.Queryable<Student>().Where(it => new int[] { 1, 2, 3 }.Contains(1)).ToList();
var test43 = db.Queryable<Student>().Where(it => new int[] { 1, 2, 3 }.Contains(it.Id)).ToList();
var test44 = db.Queryable<Student>().Select(it=>new {
x= SqlFunc.Subqueryable<DataTestInfo>().Where(x => false).Sum(x => x.Decimal1)
}).ToList();
decimal? p = null;
var test45 = db.Queryable<DataTestInfo>().Select(it => new {
x =p
}).ToList();
}
public static void Page()
{

View File

@ -144,7 +144,7 @@ namespace SqlSugar
if (readerValues.Any(it => it.Key.Equals(name, StringComparison.CurrentCultureIgnoreCase)))
{
var addValue = readerValues.ContainsKey(name) ? readerValues[name] : readerValues.First(it => it.Key.Equals(name, StringComparison.CurrentCultureIgnoreCase)).Value;
if (addValue == DBNull.Value)
if (addValue == DBNull.Value||addValue==null)
{
if (item.PropertyType.IsIn(UtilConstants.IntType, UtilConstants.DecType, UtilConstants.DobType, UtilConstants.ByteType))
{