Skip to content

fix(#425): fetching HasManyThrough returns no includes #427

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

Merged
merged 7 commits into from
Oct 14, 2018
Merged

fix(#425): fetching HasManyThrough returns no includes #427

merged 7 commits into from
Oct 14, 2018

Conversation

maurei
Copy link
Member

@maurei maurei commented Oct 14, 2018

BUG FIX

Closes issue #425

  • reproduce issue in tests
  • fix issue

Replaces pull request #426, which can be ignored and deleted.

@maurei maurei changed the title Fix: fetching HasManyThrough returns no includes fix(#425): fetching HasManyThrough returns no includes Oct 14, 2018
@@ -0,0 +1,104 @@
<!DOCTYPE html>
Copy link
Contributor

Choose a reason for hiding this comment

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

these need to be removed. doc artifacts are only supposed to be created when /p:DocFx=true and shouldn't be checked in. were these built automatically or were you building the docs intentionally?

{
Type rightInstancesListType = typeof(List<>).MakeGenericType(hasManyThroughRelation.Type);
PropertyInfo rightPropertyOnLeft = _jsonApiContext.RequestEntity.EntityType.GetProperty(hasManyThroughRelation.InternalRelationshipName);
foreach (var leftInstance in included)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is going to enumerate and materialize the query result set which is not something we should do yet. i'm thinking the work of mapping these values back should be moved to the serializer. looking closer it looks like the problem exists in the DocumentBuilder and the use of an older api that can't traverse the HasManyThrough relationship.

@jaredcnance jaredcnance merged commit cbc37d1 into json-api-dotnet:master Oct 14, 2018
@maurei maurei deleted the fix/hasmanythrough-empty-includes branch October 15, 2018 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants