Pantelis
Pantelis

Reputation: 2070

Are there any ORMs that support SQLite for Universal Apps?

That's the question. I've read that the EF7 will support SQLite for Windows Store and Windows Phone but what the deal right now? Are there any other ORMs that support SQLite on Universal Apps?

Upvotes: 3

Views: 584

Answers (1)

Benjamin Diele
Benjamin Diele

Reputation: 1187

There is CoolStorage but I don't have any experience with that ORM.

Not an ORM per se, but check out SQLite.Net together with SQLite.Net Extensions. I'm using it right now in a Universal App, and it works good enough for what I need.

Do note there's not yet support for relations in LINQ.

I myself am currently using the Extensions like this:

public class Bar
{
    [PrimaryKey, AutoIncrement]
    public int Id { get; set; }

    public string Title { get; set; }

    [ManyToMany(typeof(FooBar))]
    public List<Foo> Foos{ get; set; }
}

public class Foo
{
    [PrimaryKey, AutoIncrement]
    public int Id { get; set; }

    public string Title { get; set; }

    [ManyToMany(typeof(FooBar))]
    public List<Bar> Bars{ get; set; }
}

public class FooBar
{
    [ForeignKey(typeof(Foo))]
    public int FooId{ get; set; }

    [ForeignKey(typeof(Bar))]
    public int BarId{ get; set; }
}

Upvotes: 1

Related Questions