I have two fields in MySQL (I am not owner of this database but just using it write/read) that are of type 'JSON'. In my .Net c# project I have the DATABASE FIRST logic, the problem it is that it ignores these two fields with type 'JSON', and actually I don't know how can I make to recognize these fields to update them.
Asked
Active
Viewed 298 times
0
-
As a first shot you could try to read/write them as string or maybe binary fields. – user743414 Jan 20 '21 at 08:50
-
I tried adding it in the class auto-generated by EF, but it still can't read data – staff614 Jan 20 '21 at 09:36
1 Answers
0
According to this issue, you can do something like:
public JsonObject<string[]> Column { get; set; }
Alternatively this docs suggest you do:
// The JSON column
[Column(TypeName = "json")]
public string JObject { get; set; }

iamdlm
- 1,885
- 1
- 11
- 21
-
i tried both solutions, problem it's that i tried put a breakpoint but it never goes in action, meanwhile in others attributes it does – staff614 Jan 20 '21 at 15:11
-
ok solved, this https://stackoverflow.com/questions/35950795/adding-a-new-column-to-an-existing-table-in-entity-framework helped – staff614 Jan 20 '21 at 16:53