Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support top level Json Arrays for JsonColumns in EF #33829

Closed
AlexanderBaggett opened this issue May 28, 2024 · 1 comment
Closed

Support top level Json Arrays for JsonColumns in EF #33829

AlexanderBaggett opened this issue May 28, 2024 · 1 comment

Comments

@AlexanderBaggett
Copy link

I'm trying to store an array of json data in a column in EF

I'd like to have support for top-level Json Arrays for JsonColumns in EFCore.
Right now I have to create an empty wrapper class whose only job is to have a collection property and make that my JsonColumn via OwnsOne() and ToJson().

I'd like to be able to do OwnsMany() and ToJson() on a property which is a List and it just works.

E.g. I'd like to be able to do this:

    public class SomeEntity
    {
        public List<SomeOtherClass> Values = new List<SomeOtherClass>();
    }
    public class SomeEntity_Map : IEntityTypeConfiguration<SomeEntity>
    {
        public void Configure(EntityTypeBuilder<SomeEntity> builder)
        {
            builder.OwnsMany(x => x.Values,x =>  x.ToJson());
        }
    }
@maumar
Copy link
Contributor

maumar commented May 28, 2024

covered by #31237

@maumar maumar closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants