C# Sqlite Class table 无法添加属性 [主键]
C# Sqlite Class table Cant Add Attribute [PrimaryKey]
出于某种原因,我的代码无法识别这些属性。就像在 Xamarin 中创建 C# SQlite 数据库时所做的那样 class.
using System.Data.SQLite;
namespace DJipayeEmailer
{
class Company
{
[PrimaryKey] <----- this attribute says doesnt exist. ( i want to set it as a primary key)
public int IDCkey { get; set; }
public string Company_Name { get; set; }
除非使用 Xamarin,否则 C# 是否不允许这样做,或者我是否使用了错误的块/库?
您代码中的 命名空间 System.Data.SQLite
是关于低级 sql 操作,使用基于字符串的查询。如果你想要一些精简的 ORM 功能和 LINQ 查询,你必须安装 sqlite-net-pcl
包,你要找的属性就在那里。
出于某种原因,我的代码无法识别这些属性。就像在 Xamarin 中创建 C# SQlite 数据库时所做的那样 class.
using System.Data.SQLite;
namespace DJipayeEmailer
{
class Company
{
[PrimaryKey] <----- this attribute says doesnt exist. ( i want to set it as a primary key)
public int IDCkey { get; set; }
public string Company_Name { get; set; }
除非使用 Xamarin,否则 C# 是否不允许这样做,或者我是否使用了错误的块/库?
命名空间 System.Data.SQLite
是关于低级 sql 操作,使用基于字符串的查询。如果你想要一些精简的 ORM 功能和 LINQ 查询,你必须安装 sqlite-net-pcl
包,你要找的属性就在那里。