efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Use the JSON `id` property directly if the mapped property is already converted to a string

Open ajcvickers opened this issue 1 year ago • 1 comments

If the EF primary key property is a string, then we map it directly to the JSON id property. If it is numeric (or bool), then we map a string of the number to id but keep the numeric key property in the JSON as well, so that queries can use the numeric value rather than needing to use the string. Currently, when the key property is not a string, but is converted to a string--e.g. a GUID--then we map to both the JSON id and the original property, like for numerics. But there is no need to do this, since the id is already a string.

ajcvickers avatar Aug 28 '24 11:08 ajcvickers

Note for team: we should do this for 9 to avoid a break afterwards.

ajcvickers avatar Aug 28 '24 11:08 ajcvickers