Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added logic to allow query options in select=* calls #971

Draft
wants to merge 2 commits into
base: release-8.x
Choose a base branch
from

Conversation

corranrogue9
Copy link
Contributor

No description provided.

…nd requests to http://localhost:64771/v1/Customers?$select=FavoriteAddresses($count=true) and http://localhost:64771/v1/Customers?$select=FavoriteAddresses($count=true),*
@@ -443,6 +443,22 @@ await WriteDynamicComplexPropertyAsync(dynamicTypeProperties[property], property
ResourceContext resourceContext = new ResourceContext(writeContext, structuredType, graph);

SelectExpandNode selectExpandNode = CreateSelectExpandNode(resourceContext);
/*if (expectedType.Definition.FullTypeName() == "ODataRoutingSample.Models.Customer")

Choose a reason for hiding this comment

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

Please delete unused code, you can always retrieve it from Git.

{
//// TODO this doesn't handle cases like $select=*,path/to/definedpropery
//// TODO the defined property gets added twice, but it shouldn't be; webapi could differentiate these cases by looking for '$', but really ODL should have "subsumed" items, and "non-subsumed" items to differentaite bewten the cases
foreach (var subsumedSelectItem in wildcardSelectItem.SubsumedSelectItems.Cast<PathSelectItem>().Where(item => item.HasOptions))

Choose a reason for hiding this comment

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

var subsumedSelectItems = wildcardSelectItem.SubsumedSelectItems.Cast().Where(item => item.HasOptions);

  foreach (var subsumedSelectItem in subsumedSelectItems)

@@ -517,6 +521,21 @@ internal Expression ProjectElement(QueryBinderContext context, Expression source
continue;
}

var wildcardSelectItem = selectItem as WildcardSelectItem;
if (wildcardSelectItem != null)

Choose a reason for hiding this comment

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

Please add tests for this senario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants