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

Fix support for cast in $expand - expand some property on derived type only #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

orty
Copy link

@orty orty commented Dec 1, 2023

No description provided.

Copy link
Member

@BlaiseD BlaiseD left a comment

Choose a reason for hiding this comment

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

A test here would help persist the change.

@@ -175,6 +175,13 @@ private static Expression BuildSelectorExpression(Expression sourceExpression, L
}
else
{
if (parent.Type != parts[i].ParentType)
Copy link
Member

Choose a reason for hiding this comment

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

I think we want to throw an exception here if parent.Type is not assignable form parts[i].ParentType ?

Copy link
Author

Choose a reason for hiding this comment

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

I assumed that OData would take care of this check beforehand, and there was no tests for the validity of getting the parts[i].MemberName member out of the parent.Type type (which caused my issue btw).

Both of these errors return perfectly readable and troubleshootable error messages so.. What do you think ?

Copy link
Member

Choose a reason for hiding this comment

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

Just FYI this library does not assume an OData caller. Not a huge deal. A unique message makes it easier to pinpoint even throw new InvalidOperationException("{EFF2398E-8BA7-4A52-A098-AEDF6280F790}"); is helpful.

@orty
Copy link
Author

orty commented Dec 2, 2023

A test here would help persist the change.

I will implement the tests (both repos)

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