Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilshod Komilov committed Nov 22, 2021
1 parent 119f2a9 commit dfb9bac
Showing 1 changed file with 9 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ internal Expression ProjectElement(Expression source, SelectExpandClause selectE
LinqParameterContainer.Parameterize(typeof(string), _modelID) :
Expression.Constant(_modelID);
wrapperTypeMemberAssignments.Add(Expression.Bind(wrapperProperty, wrapperPropertyValueExpression));

if (IsSelectAll(selectExpandClause))
{
// Initialize property 'Instance' on the wrapper class
Expand Down Expand Up @@ -345,11 +346,16 @@ internal Expression ProjectElement(Expression source, SelectExpandClause selectE
}
}
}
if (isInstancePropertySet)
{
Type wrapperGenericType = GetWrapperGenericType(isInstancePropertySet, isTypeNamePropertySet, isContainerPropertySet);
wrapperType = wrapperGenericType.MakeGenericType(elementType);
return Expression.MemberInit(Expression.New(wrapperType), wrapperTypeMemberAssignments);
}
ConstructorInfo constructorWithInstanse = wrapperType.GetConstructors().Single(c => c.GetParameters().Length == 1);
return Expression.MemberInit(Expression.New(constructorWithInstanse, source), wrapperTypeMemberAssignments);

Type wrapperGenericType = GetWrapperGenericType(isInstancePropertySet, isTypeNamePropertySet, isContainerPropertySet);
wrapperType = wrapperGenericType.MakeGenericType(elementType);

return Expression.MemberInit(Expression.New(wrapperType), wrapperTypeMemberAssignments);
}

/// <summary>
Expand Down Expand Up @@ -1243,54 +1249,18 @@ property selection combination possible. */

private class SelectAllAndExpand<TEntity> : SelectExpandWrapper<TEntity>
{
public SelectAllAndExpand(TEntity entity) : base(entity)
{

}

public SelectAllAndExpand()
{

}
}

private class SelectAll<TEntity> : SelectExpandWrapper<TEntity>
{
public SelectAll(TEntity entity) : base(entity)
{

}

public SelectAll()
{

}
}

private class SelectSomeAndInheritance<TEntity> : SelectExpandWrapper<TEntity>
{
public SelectSomeAndInheritance(TEntity entity) : base(entity)
{

}

public SelectSomeAndInheritance()
{

}
}

private class SelectSome<TEntity> : SelectAllAndExpand<TEntity>
{
public SelectSome(TEntity entity) : base(entity)
{

}

public SelectSome()
{

}
}
}
}

0 comments on commit dfb9bac

Please sign in to comment.