I'm using Dapper with Npsql (Postgres). I'm saving a serialized list of strings to one column called tags:
values.Tags = new List<string>() { "first", "second" };
await Connection.ExecuteAsync(
@"INSERT INTO account (text, tags) VALUES (@text, ARRAY [@tags]);",
new
{
text = values.Text,
tags = values.Tags
}
);
which is resulting in {{first,second}} in the database.
My question is how to read it back to the model? Do I need some special SQL, or can I use SELECT id, text, tags FROM account;?
How can I dapper tell to deserialize it back to List<string>?
Thanks
{Name = "String[,]" FullName = "System.String[,]"}.reader.GetValue(2)value is{string[1, 2]}of typeobject {string[,]}.