Skip to content

Map part of the entity to Json column without the need of Owned entity container. #30094

Closed as not planned
@dsidedp

Description

@dsidedp

Allow to map part of the entity (i.e. multiple properties) to a single Json column without the need of wrapping them into Owned entity.

Given class

public class RangeItem
{
    public int Quantity { get; set; }
    public int From { get; set; }
    public int To { get; set; }
    <...>
}

configuration could look like

builder.Entity<RangeItem>.Property(x => x.Quantity).ToJson("Details").HasJsonPropertyName("Quantity");
builder.Entity<RangeItem>.Property(x => x.From).ToJson("Details").HasJsonPropertyName("From");
builder.Entity<RangeItem>.Property(x => x.To).ToJson("Details").HasJsonPropertyName("To");

In case of class hierarchy (TPH) reuse of the same Json column should be allowed as well.
This will require something similar to JSON column sharing.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions