【问题标题】:is sqlite-net-pcl library support one to many or many to many relationship - Xamarinsqlite-net-pcl 库是否支持一对多或多对多关系 - Xamarin
【发布时间】:2018-10-08 11:38:48
【问题描述】:

我对 xamarin 表单完全陌生,我想与 sqlite-net-pcl 库创建一对多的关系。请帮我解决这个问题。

【问题讨论】:

  • @Jason 我已经明确说过 sqlite-net-pcl 库,你给了我 SQLiteNETExtension 库,此外,你还否决了我的问题。
  • "SQLite-Net Extensions 是一个非常简单的 ORM,它提供了一对一、一对多、多对一、多对多、反向和文本块状关系在 sqlite-net 库之上。”
  • 我也对您的问题投了反对票(并标记为关闭)。它太宽泛、不清楚,甚至看起来不像on-topic。尽管如此,根据我们对您所写的猜测,该包裹似乎适合您。如果没有,您可以将您的问题编辑得更具体,而不是抱怨。看看How to Ask

标签: sqlite xamarin xamarin.forms sqlite-net-pcl


【解决方案1】:

你的意思是这样的吗?

public class Person
{
    [PrimaryKey]
    public int id { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }

    public Person()
    {

    }
}

public class Pet
{
    [PrimaryKey]
    public int id { get; set; }
    public int PersonID { get; set; }
    public string Name { get; set; }

    public Pet()
    {

    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-13
    • 2014-04-03
    • 2018-06-15
    • 2021-04-01
    • 2015-11-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多