Skip to content

feat: Support json-mapped external type properties on Coalesce entities#677

Merged
ascott18 merged 9 commits intomainfrom
copilot/explore-complex-json-entity-fields
Mar 18, 2026
Merged

feat: Support json-mapped external type properties on Coalesce entities#677
ascott18 merged 9 commits intomainfrom
copilot/explore-complex-json-entity-fields

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 13, 2026

  • Guard JsonCollection/ComplexCollection behind #if NET10_0_OR_GREATER
  • Fix TypeScript test type errors (new WeatherData(...), null assertion)
  • Guard C# test cases with #if NET10_0_OR_GREATER
  • Add "JSON-mapped Complex Types" section to docs/modeling/model-components/properties.md
  • Add 6.3 entry to CHANGELOG.md
Original prompt

This section details on the original issue you should resolve

<issue_title>Explore complex json db-mapped entity fields</issue_title>
<issue_description>We already support json-mapped primitive collections, which get automatically mapped to json in the DB by EF with no special configuration. Explore what it would take to expand this to more complex scenarios (are there C# annotations for these?)

  • Json-mapped object on entity
  • Json-mapped collection of objects on entity</issue_description>

Comments on the Issue (you are @copilot in this section)

@ascott18 https://github.com/dotnet/efcore/issues/31252 @ascott18 ComplexTypeAttribute + [Column(TypeName = "json")]??? Will EF pick that up? @ascott18 Note: The "Property is non-scalar" logic in PropertySecurityInfo is one of the obstacles that will need to be adjusted to make this work. It seems that the comment in that code doesn't actually describe what the code is doing.

The EF configuration is .ComplexCollection(a => a.MyJsonCollection, cb => cb.ToJson()) or .ComplexProperty(a => a.Characteristics, cb => cb.ToJson()). I don't think we really need a special Coalesce attribute to pick this up. Extend the existing logic with hasWatcherFlag in viewmodel.ts for primitive collections to make this work with dirty checking.</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: ascott18 <5017521+ascott18@users.noreply.github.com>
Copilot AI changed the title [WIP] Explore complex json db-mapped entity fields feat: Support json-mapped external type properties on Coalesce entities Mar 13, 2026
Copilot AI requested a review from ascott18 March 13, 2026 01:37
…, fix TypeScript test types

Co-authored-by: ascott18 <5017521+ascott18@users.noreply.github.com>
@ascott18
Copy link
Copy Markdown
Collaborator

@copilot add/update documentation and update the changelog. This is now version 6.3 instead of 6.2.3.

Co-authored-by: ascott18 <5017521+ascott18@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 13, 2026

@copilot add/update documentation and update the changelog. This is now version 6.3 instead of 6.2.3.

Done in 23e9094. Added a "JSON-mapped Complex Types" section to docs/modeling/model-components/properties.md and added a 6.3 entry to CHANGELOG.md.

@ascott18 ascott18 marked this pull request as ready for review March 18, 2026 21:41
@ascott18 ascott18 merged commit 3e1bb0e into main Mar 18, 2026
14 checks passed
@ascott18 ascott18 deleted the copilot/explore-complex-json-entity-fields branch March 18, 2026 21:42
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.

Explore complex json db-mapped entity fields

2 participants