Skip to content

ExpandoObject with Nullable types only return "HasValue" #103

Closed
@bsohi

Description

@bsohi

Hi,

I am using below code to set up parameter dynamically.

CallSiteBinder leftHandSideParameterName = Binder.GetMember(
    CSharpBinderFlags.None,
    condition.InternalFieldName,
    typeof(object),
    new CSharpArgumentInfo[]
    {
        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
    });

var lhsExpression = Expression.Convert(
    Expression.Dynamic(leftHandSideParameterName, typeof(object), parameterExpression),
    dataType);

ToReadableString() is broken since I upgraded the various packages in my solution. I am not certain which assembly is causing this. It was returning same information as ExpressionTreeVisualizer before the upgrade.

Output by ReadableExpressions (in debug mode)
expandoObject => (HasValue && HasValue) && !HasValue

Output by ExpressionTreeVisualizer (in debug mode)
(ExpandoObject ) => (DateTime?).PreProjectApprovalDate.HasValue && (DateTime?).PreApprovalReviewTimerPause.HasValue && !(DateTime?).PreApprovalReviewTimerUnpause.HasValue

I tried to debug the issue and MemberAccess only returning HasValue instead of PreProjectApprovalDate.HasValue.

The strange this is it was working fine before upgrade.

.net Frameowrk 4.7.2
VS2019
MVC Web API - 5.2.7

Please advise what can be the issue?

Thx
Balwinder

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions