Mher Arsh
Mher Arsh

Reputation: 597

ServiceStack OrmLite: JSON fild deserialization Issue

I have a table in MySql:

CREATE TABLE db.catalog (
    id varchar(36) NOT NULL,
    pictures json DEFAULT NULL
)

and declaration form code

public class catalog {        
   public string id { get; set; }
   public List<string> pictures { get; set; }
}

and I have data: pictures = ["JavaScript", "ES2015", "JSON"]

enter image description here

When you run the query through OrmLite deserializing is not correct...

It is evident that the deserialization as in the cases of key-value data.

I'm doing something wrong? or is it meant to be?

Thanks!

enter image description here

Upvotes: 1

Views: 63

Answers (1)

Mher Arsh
Mher Arsh

Reputation: 597

This code will help, the question is closed:

MySqlDialect.Provider.StringSerializer = new JsonDataContractSerializer();

Thanks @mythz: https://stackoverflow.com/a/35186935/7015077

Upvotes: 1

Related Questions