Document advanced user-defined function mapping - #5459
Draft
AndriySvyryd with Copilot wants to merge 4 commits into
Draft
Document advanced user-defined function mapping#5459AndriySvyryd with Copilot wants to merge 4 commits into
AndriySvyryd with Copilot wants to merge 4 commits into
Conversation
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add missing content to user defined function mapping
Document advanced user-defined function mapping
Aug 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Expands advanced EF Core user-defined function mapping documentation and samples.
Changes:
- Adds lambda registration, schema, nullability, and translation guidance.
- Demonstrates SQL Server
JSON_VALUEwith converted CLR types. - Clarifies
HasTranslationlimitations and nullability propagation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
Program.cs |
Adds the JSON function query. |
Model.cs |
Adds JSON entity, conversion, and function mapping. |
user-defined-function-mapping.md |
Documents advanced mapping APIs and behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+162
to
+166
| modelBuilder.Entity<JsonEntity>() | ||
| .Property(e => e.Metadata) | ||
| .HasConversion( | ||
| value => JsonSerializer.Serialize(value, (JsonSerializerOptions)null), | ||
| value => JsonSerializer.Deserialize<Dictionary<string, string>>(value, (JsonSerializerOptions)null)); |
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The user-defined function mapping guide omitted several registration, type-mapping, nullability, and translation APIs. It also lacked a practical built-in JSON function example.
Function registration
HasDbFunctionregistration and default arguments.DbFunctionAttribute, schemas, built-in functions, and nullability metadata.Store-type and JSON mapping
JSON_VALUEexample and clarify value-converter limitations.PropagatesNullabilityand link it to query null semantics.HasTranslationSQL expression trees.HasTranslation.