dotnet / dotnet/efcore

Allow providers to overwrite structural type scalar property order

Open
#38,619 1 comment 0 reactions 0 assignees View on GitHub
area-model-building consider-for-next-release customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

### What problem are you trying to solve?

Structural type scalar property order is determined internally by Core using `PropertyNameComparer`, and can't be overwritten by providers. However a different order might be warrented in some cases. For example: JSON entities that support inheritance hierarchies might want to put the discriminator as the first property for faster materialization. This is currently the case for the Cosmos DB provider.

### Describe the solution you'd like

Some way to overwrite scalar property order for structural type instances

Contributor guide

Open the contributing guide

Research direction

Start by tracing Core's PropertyNameComparer and the structural type scalar property ordering, then compare how the Cosmos DB provider currently handles discriminator placement. Done means providers have a defined way to override scalar property order for structural type instances without breaking existing ordering behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.