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

Add relational JSON mapping support for complex types #31252

Open
Tracked by #31238 ...
AndriySvyryd opened this issue Jul 12, 2023 · 8 comments
Open
Tracked by #31238 ...

Add relational JSON mapping support for complex types #31252

AndriySvyryd opened this issue Jul 12, 2023 · 8 comments

Comments

@AndriySvyryd
Copy link
Member

No description provided.

@Timovzl
Copy link

Timovzl commented Oct 25, 2023

If the property being mapped here is a collection [of value objects], perhaps structural equality should be preferred on the collection. The value objects inside can simply override Equals() et al, but that is not as feasible for the collection holding them.

@roji
Copy link
Member

roji commented Oct 25, 2023

@Timovzl structural equality is definitely planned for the collections, just as it already works for the complex types themselves. However, in change tracking EF doesn't compare complex types to one another directly (e.g. via their Equals), but rather compares the properties contained in the complex types (since it needs to know which properties changed).

@aradalvand
Copy link

aradalvand commented Nov 19, 2023

Already the second most upvoted open issue in the repo in just over 4 months 😅 People seem to really want this!

image

@roji

This comment was marked as off-topic.

@inetdevgit
Copy link

Shouldn't be stored in JSON because complex type only meant for the app designed for it. DB itself should considered accessed by other app as well such as SSMS. But I do prefer complex type in my App while keeping flat for SSMS or others.

@roji
Copy link
Member

roji commented May 6, 2024

@inetdevgit I'm not sure what you mean in your comment... This issue is about allowing complex types to be mapped to JSON, but by default, non-collection complex types will still be "flattened" (i.e. no mapped as JSON). For collections of complex types, we don't plan to support any other mapping form other than JSON.

Regardless, storing data as JSON columns is a standard and supported SQL Server feature, and not some EF-specific thing; needing to use SSMS (or other apps) should not be a reason to avoid JSON.

@m-dehghani

This comment has been minimized.

@roji

This comment has been minimized.

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

No branches or pull requests

7 participants