【发布时间】:2014-07-22 17:27:36
【问题描述】:
这就是问题所在。我听说 EF7 将支持 Windows Store 和 Windows Phone 的 SQLite,但现在有什么交易?是否有任何其他 ORM 支持通用应用程序上的 SQLite?
【问题讨论】:
标签: sqlite orm windows-store-apps windows-phone-8.1 win-universal-app
这就是问题所在。我听说 EF7 将支持 Windows Store 和 Windows Phone 的 SQLite,但现在有什么交易?是否有任何其他 ORM 支持通用应用程序上的 SQLite?
【问题讨论】:
标签: sqlite orm windows-store-apps windows-phone-8.1 win-universal-app
有 CoolStorage,但我对那个 ORM 没有任何经验。
本身不是 ORM,但请查看 SQLite.Net 和 SQLite.Net Extensions。 我现在正在一个通用应用程序中使用它,它可以满足我的需要。
请注意这里有not yet support for relations in LINQ。
我自己目前正在使用这样的扩展:
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; }
}
【讨论】: