Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1227,12 +1227,10 @@ private Expression AddOrderByQueryForSource(QueryBinderContext context, Expressi
return source;
}

private QueryBinderContext CreateSubContext(QueryBinderContext context, ComputeClause computeClause, Type clrElementType,
HandleNullPropagationOption option = HandleNullPropagationOption.True)
private QueryBinderContext CreateSubContext(QueryBinderContext context, ComputeClause computeClause, Type clrElementType)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not pass the HandleNullPropagation in the caller. For example:

  • In SelectExpandBinder, you can pass as follows:
    // rest of code ..
    QueryBinderContext subContext = CreateSubContext(context, computeClause, clrElementType, settings.HandleNullPropagation);
    // rest of code ...

Copy link
Author

@DanielBertocci DanielBertocci Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @WanjohiSammy. The reason why I didn't pass HandleNullPropagation in the caller is because CreateSubContext originally clones the settings:

ODataQuerySettings newSettings = new ODataQuerySettings();
newSettings.CopyFrom(context.QuerySettings);

The CopyFrom method does copy the HandleNullPropagation value:

internal void CopyFrom(ODataQuerySettings settings)
{
    // ...
    HandleNullPropagation = settings.HandleNullPropagation;
    // ...
}

I kept this approach because the original code also cloned context.QuerySettings, and I wanted to preserve that behavior unless there's a specific reason to move to the overload that takes HandleNullPropagation directly. If using the explicit overload is preferred for clarity, I can switch to that as well.

{
ODataQuerySettings newSettings = new ODataQuerySettings();
newSettings.CopyFrom(context.QuerySettings);
newSettings.HandleNullPropagation = option;
QueryBinderContext binderContext = new QueryBinderContext(context, newSettings, clrElementType);
if (computeClause != null)
{
Expand Down