如果我为 windows phone 使用 SQL Server CE,我可以选择类的哪些属性映射到数据库表。这允许我在一个类上拥有抽象属性。
例如
[Table]
public class MyClass
{
// this property is written to the database
private int _ItemId;
[Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
public int ItemId
{
get
{
return _ItemId;
}
set
{
_ItemId = value;
}
}
// abstract class. obviously this just an example. the real code checks for 11. =)
// under SQLite, it looks like this will get stored in the db?
public bool IsItemIdSeven
{
get{ return _ItemId == 7; }
}
}
是否可以从 SQLite-net 中的类定义中排除属性?我不能使用扩展,因为其中一些属性被 UI 绑定使用。