ror*_*yok 6 sqlite sql-server-ce windows-phone-8 sqlite-net
如果我使用SQL Server CE for Windows phone,我可以选择类映射到数据库表的哪些属性.这允许我在类上具有抽象属性.
例如
[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; }
}
}
Run Code Online (Sandbox Code Playgroud)
是否可以从SQLite-net中的类定义中排除属性?我不能使用扩展,因为UI绑定使用了一些这些属性.