wordpress   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Windows Phone:如何在SQLite-net中排除列/属性?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

如果我使用sqL Server CE for Windows phone,我可以选择类映射到数据库表的哪些属性.这允许我在类上具有抽象属性. 例如 [Table] public class MyClass { // this property is written to the database privatE int _ItemId; [column(IsPriMary
如果我使用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; }
    }
}

是否可以从sqlite-net中的类定义中排除属性?我不能使用扩展,因为UI绑定使用了一些这些属性.

如果您使用的是 SQLite-net,则可以使用[忽略]属性

大佬总结

以上是大佬教程为你收集整理的Windows Phone:如何在SQLite-net中排除列/属性?全部内容,希望文章能够帮你解决Windows Phone:如何在SQLite-net中排除列/属性?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。