Skip to content Skip to sidebar Skip to footer

Sqlite Not Recognizing Generic List

On a windows store app project i get a JSON from a webservice that looks like this:http://paste2.org/jfMJ2AGA and i have these 2 classes public class media { public string id

Solution 1:

Sqllite does not support lists. This means that you can´t have

public List<media> media { get; set; } 

Solution 2:

I had the same problem with an int[] and I did this:

[Table(nameof(Folder))]
public class Folder
{
    public Folder()
    {
        // for SQLite
    }
    internal Folder(Json.Folder folder)
    {
        Id = folder.id;
        Title = folder.title;
        Lists = string.Join(",", folder.list_ids);
    }

    [PrimaryKey]
    public int Id { get; set; }
    public string Title { get; set; }
    public string Lists { get; set; }
    public int[] ListsArray => Lists.Split(',').Select(x => int.Parse(x)).ToArray();
}

Post a Comment for "Sqlite Not Recognizing Generic List"