mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 10:24:55 +08:00
Update .net core project
This commit is contained in:
@@ -250,13 +250,42 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
navObjectNamePropety.SetValue(listItem, instance);
|
if (sql.Skip != null || sql.Take != null)
|
||||||
|
{
|
||||||
|
var instanceCast = (instance as IList);
|
||||||
|
var newinstance = Activator.CreateInstance(navObjectNamePropety.PropertyType, true) as IList;
|
||||||
|
SkipTakeIList(sql, instanceCast, newinstance);
|
||||||
|
navObjectNamePropety.SetValue(listItem, newinstance);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
navObjectNamePropety.SetValue(listItem, instance);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void SkipTakeIList(SqlInfo sql, IList instanceCast, IList newinstance)
|
||||||
|
{
|
||||||
|
var intArray = Enumerable.Range(0, instanceCast.Count);
|
||||||
|
if (sql.Skip != null)
|
||||||
|
{
|
||||||
|
intArray = intArray
|
||||||
|
.Skip(sql.Skip.Value);
|
||||||
|
}
|
||||||
|
if (sql.Take != null)
|
||||||
|
{
|
||||||
|
intArray = intArray
|
||||||
|
.Take(sql.Take.Value);
|
||||||
|
}
|
||||||
|
foreach (var i in intArray)
|
||||||
|
{
|
||||||
|
newinstance.Add(instanceCast[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OneToOne(List<object> list, Func<ISugarQueryable<object>, List<object>> selector, EntityInfo listItemEntity, System.Reflection.PropertyInfo navObjectNamePropety, EntityColumnInfo navObjectNameColumnInfo)
|
private void OneToOne(List<object> list, Func<ISugarQueryable<object>, List<object>> selector, EntityInfo listItemEntity, System.Reflection.PropertyInfo navObjectNamePropety, EntityColumnInfo navObjectNameColumnInfo)
|
||||||
{
|
{
|
||||||
var navColumn = listItemEntity.Columns.FirstOrDefault(it => it.PropertyName == navObjectNameColumnInfo.Navigat.Name);
|
var navColumn = listItemEntity.Columns.FirstOrDefault(it => it.PropertyName == navObjectNameColumnInfo.Navigat.Name);
|
||||||
|
|||||||
@@ -540,7 +540,7 @@ namespace SqlSugar
|
|||||||
ConditionalType = ConditionalType.Equal,
|
ConditionalType = ConditionalType.Equal,
|
||||||
FieldName = column.DbColumnName,
|
FieldName = column.DbColumnName,
|
||||||
FieldValue = value.ObjToString(),
|
FieldValue = value.ObjToString(),
|
||||||
CSharpTypeName=column.PropertyInfo.PropertyType.Name
|
CSharpTypeName=column.UnderType.Name
|
||||||
});
|
});
|
||||||
if (value != null && value.GetType().IsEnum())
|
if (value != null && value.GetType().IsEnum())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
leftExpression = (leftExpression as UnaryExpression).Operand;
|
leftExpression = (leftExpression as UnaryExpression).Operand;
|
||||||
}
|
}
|
||||||
if (rightExpression is UnaryExpression && (rightExpression as UnaryExpression).Operand.Type == UtilConstants.BoolType && (rightExpression as UnaryExpression).NodeType == ExpressionType.Convert)
|
if (rightExpression is UnaryExpression&& (rightExpression as UnaryExpression).NodeType == ExpressionType.Convert)
|
||||||
{
|
{
|
||||||
rightExpression = (rightExpression as UnaryExpression).Operand;
|
rightExpression = (rightExpression as UnaryExpression).Operand;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user