Support seeding for JSON POCOs
See original GitHub issueI’m trying to use a POCO mapping (to use a jsonb column with a list of a defined object). When I try to run a migration I get an error:
Cannot scaffold C# literals of type ‘System.Collections.Generic.List`1[Api.Models.UserType]’. The provider should implement CoreTypeMapping.GenerateCodeLiteral to support using it at design time.
Small project to reproduce the issue: WebApplication2.zip
The only way I’ve found to achieve this is to create a String and make the JsonSerializer.Serialize() by myself wich is not the best solution at all.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Support seeding for JSON POCOs -
I'm trying to use a POCO mapping (to use a jsonb column with a list of a defined object). When I try to...
Read more >Parser throws Poco::JSON::JSONEception error
I am trying to parse a JSON object with poco parser. I am running into a Poco::JSON::JSONException at xxx memory location. I don't...
Read more >Performing seed data to database from JSON using reflection
Seeding with JSON data · Step 1: Add JSON file · Step 2: Update Startup file · Step 3: create the Seeding class....
Read more >POCO C++ Libraries Release Notes
New JWT library for dealing with JSON Web Tokens. Upgrade bundled SQLite to version 3.31.0. The NetSSL_OpenSSL library supports TLS 1.3 with OpenSSL...
Read more >EF Core 7: It Just Keeps Getting Better
Because of this, direct support for JSON columns has been a highly requested feature for EF Core. Finally with EF Core 7, it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As this may go well together with the general push for JSON support in EF Core, I’ve put this in the 6.0 milestone - but I wouldn’t say this is the highest-priority item…
This is currently unsupported; if you use JSON POCO mapping, you’ll have to take care of seeding yourself.
The type mapping could use reflection to discover public properties which are readable and writable, and generate the proper C# code based on that. This will probably require some additions to code generation on the EF Core upstream side.