Skip to content

Nested sparse fields#436

Merged
jaredcnance merged 3 commits into
json-api-dotnet:masterfrom
milosloub:feat/#434
Nov 13, 2018
Merged

Nested sparse fields#436
jaredcnance merged 3 commits into
json-api-dotnet:masterfrom
milosloub:feat/#434

Conversation

@milosloub

@milosloub milosloub commented Oct 24, 2018

Copy link
Copy Markdown
Contributor

Closes #434

Changed files:

  1. IQueryableExtensions - new CallGenericSelectMethod() to build Select() expression trees for requested entity, [HasOne] and [HasMany] relationships
  2. EntityResourceService - only fix to return FirstOrDefault() instead of FirstOrDefaultAsync() if fields are requested. See Query: Problems with GroupBy and nested selects dotnet/efcore#6573
  3. QueryParser - expanded to load relationship attributes and build field queries like "Owner.FirstName"
  4. SparseFieldSetTests - 3 new tests: Get all, Get one with HasOne included and Get one with HasMany included
  5. QueryParser_Tests - only new List<Relationships> in mock

@milosloub milosloub changed the title Feat/#434 Nested sparse fields Oct 24, 2018

@jaredcnance jaredcnance left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!


var value = await _entities.FirstOrDefaultAsync(query);
TEntity value;
// https://github.com/aspnet/EntityFrameworkCore/issues/6573

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

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.

Nested sparse fieldsets

2 participants