dotnet / dotnet/efcore

Json: for entities mapped to json with clr property Id, don't configure that property as key by convention

Open
#28,598 2 comments 0 reactions 0 assignees View on GitHub
area-json area-model-building
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

We don't support explicitly defined keys for json (yet), the convention would set the property to be a key and it will throw in validation. We should change the convention that marks properties as keys for entities mapped to json, so that they don't don anything.

Workaround if one really wants "Id" property in their JSON, is to name the clr property something else and use `.HasJsonPropertyName("Id")`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.