dotnet / dotnet/efcore

Json: in migrations, improve the order in which we generate json columns in the table

Open
#28,539 0 comments 1 reaction 0 assignees View on GitHub
area-json
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

Currently we scaffold non-json columns (respecting their order) and then we scaffold all json columns in alphabetical order. Ideally we would put json column in the position that the navigation it's containing is placed in the entity, e.g.

```cs
public class Customer
{
public int Id {get;set;}
public Address WorkAddress {get;set;} // mapped to json
public Address HomeAddress {get;set;} // mapped to json
public string Name {get;set;}
}
```

we should create columns in this order:
```Id, WorkAddress, HomeAddress, Name```

but currently we create:
```Id, Name, HomeAddress, WorkAddress```

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.