Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ClrCollectionAccessor cleanup for complex JSON collections#36618

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
roji wants to merge1 commit intodotnet:release/10.0
base:release/10.0
Choose a base branch
Loading
fromroji:ClrCollectionAccessor

Conversation

@roji
Copy link
Member

@AndriySvyryd, this is some WIP on switching from ClrCollectionAccessor to ClrIndexCollectionAccessor for complex JSON collections in the shaper, as discussed offline. See below for some possible issues - feel free to push changes to this PR from your side (or completely take over it if you want.

varresult=(TResult)collectionAccessor!.Create();
// var collectionAccessor = relationship.GetCollectionAccessor();
#pragma warning disableEF1001// Internal EF Core API usage.
varcollectionAccessor=((IRuntimePropertyBase)relationship).GetIndexedCollectionAccessor();
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

GetIndexedCollectionAccessor() is only available on IRuntimePropertyBase (unlike GetCollectionAccessor() which is available on IPropertyBase). I don't have strong feelings here but maybe seems like they should be consistent?

Also note that GetIndexedCollectionAccessor is pubternal (another thing to maybe change).

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this is pubternal until we are satisfied with the API

manager.CaptureState();
varentity=innerShaper(queryContext,newKeyPropertyValues,jsonReaderData);
collectionAccessor.AddStandalone(result,entity);
//collectionAccessor.AddStandalone(result, entity);
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I have no idea what this means (yet) but it doesn't exist on ClrIndexedCollectionAccessor.

Copy link
Member

Choose a reason for hiding this comment

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

It allows to add an element to the collection without the containing object. We could addSetStandalone andCreateStandalone if necessary

Copy link
Member

Choose a reason for hiding this comment

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

Actually,Create should just be renamed toCreateStandalone as that would reflect the current behavior. Note that because the containing object could be a value type you would need to either useCreateStandalone withSetStandalone to populate the collection before materializing the containing object. Or useCreateStandalone andSet after materializing it.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@AndriySvyrydAndriySvyrydAwaiting requested review from AndriySvyryd

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@roji@AndriySvyryd

[8]ページ先頭

©2009-2025 Movatter.jp