You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
materialize entities in the database with mapped properties stored as db provider specific json
what i'd like to do is
ingest arbitrary json and store it in a column without using necessarily efcore, in dbprovider native json column
use efcore to map pocos to entities in db provider native json column
in other words the use case calls for some non-efcore process to acquire and persist json, presumably in a manner amenable to subsequent consumption by a efcore 7 dbcontext
in the scenario, the 'json ingestion, persist to db' workflow is assumed not to have access to poco clr types, and an asssociated dbcontext
please advise
The text was updated successfully, but these errors were encountered:
You can store JSON in a database column using whatever means you like, doesn't have to be thru EF. EF expects it to be in a certain format - we store it very close to how System.Text.Json.JsonSerializer does it with it's default settings - the only difference is that EF stores enum values as strings, rather than ints.
We plan to add customizable serialization options in the future (tracked here: #28043)
But even currently you should be able to serialize an object using JsonSerializer (or manually craft the JSON string, or whatever), store it a JSON column in SQL Server using your preferred method, then configure EF model to map a POCO structure to that JSON column and proceed from there as if you've done everything using EF from the start.
Ask a question
my understanding of json support in efcore 7
what i'd like to do is
in other words the use case calls for some non-efcore process to acquire and persist json, presumably in a manner amenable to subsequent consumption by a efcore 7 dbcontext
in the scenario, the 'json ingestion, persist to db' workflow is assumed not to have access to poco clr types, and an asssociated dbcontext
please advise
The text was updated successfully, but these errors were encountered: