I have an SQLite table "phrases" like:
CREATE TABLE [phrases] (
[id] INTEGER PRIMARY KEY AUTOINCREMENT,
[phrase] CHAR,
[parent_id] INTEGER);
and I fill it with demo data:
id | phrase | parent_id
1 | parent phrase | (null)
2 | some child 1 | 1
3 | some child 2 | 1
And I have a C# model like:
class Phrase
{
int id { get; set; }
string phrase { get; set; }
int parent_id { get; set; }
Phrase parent { get; set; }
}
How can I correctly use Dapper to map this table to this class? Thanks.