【发布时间】:2017-10-12 17:00:21
【问题描述】:
我正在我的 Xamarin 应用程序中创建一个 SQLITE 表,如下所示:
public class ClickHistory
{
[PrimaryKey, NotNull]
public string Yymmdd { get; set; }
public int DayOfYear { get; set; }
public int Year { get; set; }
public int Month { get; set; }
public int Day { get; set; }
public int BtnACount { get; set; }
public int BtnBCount { get; set; }
public int BtnCCount { get; set; }
public int BtnDCount { get; set; }
}
db2.CreateTable<ClickHistory>();
谁能帮助我,告诉我如何将 BtnACount、BtnBCount、BtnCCount、BtnDCount 列的默认值设置为 0。现在,当我执行插入但不指定这些列时,它默认为 null .
请注意在另一个问题中建议的解决方案,一个人为我标记为重复:
[NotNull, Default(value: true)]
在带有 Xamarin 的 SQLITE 版本中不起作用
【问题讨论】:
-
如果你使用它会得到什么?
-
您使用的是哪个特定的包名称/版本?
-
你有解决办法吗?
标签: xamarin xamarin.forms