------------------------------------------------------------
Gentle.NET Attribute
------------------------------------------------------------
数据表特性(用在实体类上)
    [TableName("Product", CacheStrategy.Temporary)]
    注:缓存策略
        public enum CacheStrategy
        {
            Never,           // 每次都直接从数据库获取记录
            Temporary,       // 读取记录后丢到Cache中,并指定失效时间。每次查询时先尝试从cache中获取,若不存在才查询数据库
            Permonent        // 类似Tempory,但不指定失效时间
        }

数据字段特性
    针对不同的数据库以下特性部分有效,具体请查看pdf文档Page55-57
        [Size]
        [Type]
        [IsNullable]
        [IsUnique]
        [IsPrimaryKey]
        [IsForeignKey]
        [IsAutoGenerated]
    例如:主键,自增字段
  [TableColumn("id", NotNull=true), PrimaryKey(AutoGenerated=true)]
  protected int id;
  [TableColumn("name", NullValue="")]
  protected string name;

[TableColumn( "ph_Id", NotNull=true ), PrimaryKey( AutoGenerated=true ), SequenceName( "PROPERTYHOLDER_SEQ" )]
     public virtual int Id
     {
      get { return id; }
      set { id = value; }
     }
    Gentle.Framework Attribute
        [Concurrency]
        [CustomView]
        [ForeignKey]
        [Inheritance]
        [PrimaryKey]
        [SequenceName]
        [SoftDelete]
        [TableColumn]
        [TableName]

数据视图特性(用在Property上)Gentle.Common.Attributes
    以下特性可用在Property上
        [Caption("Caption")]
        [AllowSort(false)]
        [ReadOnly(false)]
        [Visible(false)]
    例如   
        [Caption("Company"), ReadOnly(true)]
        property string CompanyName
        {
            get{ return companyName; }
            set{ companyName = value; }
        }
        [AllowSort(false)]
        public string Name
        {
            get { return mName; }
            set { mName = value; }
        }
        [Visible(false)]
        public string Name
        {
            get { return mName; }
            set { mName = value; }
        }

数据校验特性 
    [RegexValidator(Expression=@"[A-Z]+[a-z])]
    [RequiredValidator()]
    [RangeValidator( Min=20.5, Max=100.5 )]

Gentle.NET Attribute相关推荐

  1. 【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](7)

    [论文阅读]A Gentle Introduction to Graph Neural Networks [图神经网络入门](7) Into the Weeds Other types of grap ...

  2. 【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](6)

    [论文阅读]A Gentle Introduction to Graph Neural Networks [图神经网络入门](6) GNN playground Some empirical GNN ...

  3. 【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](5)

    [论文阅读]A Gentle Introduction to Graph Neural Networks [图神经网络入门](5) Graph Neural Networks 图神经网络 Now th ...

  4. 【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](4)

    [论文阅读]A Gentle Introduction to Graph Neural Networks [图神经网络入门](4) The challenges of using graphs in ...

  5. 【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](1)

    [论文阅读]A Gentle Introduction to Graph Neural Networks [图神经网络入门](1) 最近读了一篇Distill网站上的一篇文章,讲的是图神经网络的入门, ...

  6. Gentle中的数据表实体类相关自定义属性的设置和获得

    1.自定义 表名属性 TableNameAttribute 2.自定义 主键属性 PrimaryKeyAttribute 3.自定义 列名属性 TableColumnAttribute 4.数据表pe ...

  7. Gentle.NET 使用文档

    ------------------------------------------------------------ 概述 ------------------------------------ ...

  8. Python错误:AttributeError: 'generator' object has no attribute 'next'解决办法

    今天在学习生成器对象(generation object)运行以下代码时,遇到了一个错误: #定义生成器函数 def liebiao(): for x in range(10): yield x #函 ...

  9. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class

    最近安装项目到自己oppo手机上提示Error:warning: Ignoring InnerClasses attribute for an anonymous inner class,但是在模拟机 ...

最新文章

  1. 0011_练习题d1
  2. 8.Deep Interest Evolution Network for Click-Through Rate Prediction论文详解
  3. 百度地图3.1课程—检索演示
  4. POJ1201基础差分约束
  5. Android中的AsyncTask异步任务的简单介绍
  6. [iOS]利用通知实现监听系统键盘
  7. python对象点方法_python面向对象知识点疏理
  8. oracle查看表空间和物理文件大小
  9. C++模板元 -- 变长参数模板
  10. JS 正则(RegExp)
  11. python列表、元组、字典、集合区别及他们之间的转换(超全)
  12. 如何在整个数据库中查寻一条数据?
  13. 2007五一[西北行] - 第二天:延安(窑洞,杨家岭,宝塔山...)
  14. 【小程序源码】视频壁纸支持多种分类短视频另外也有静态壁纸
  15. 法国主要贸易海港加入区块链货运物流试点
  16. 计算机域名长啥样,域名是什么 什么样的域名是一个好域名【详解】
  17. 小米将推运动相机无疑,但它进入的是个怎样的市场?
  18. Tomcat-Session反序列化学习
  19. js---javaScript基础知识
  20. 瞬间击退眼睛疲劳的五大运动

热门文章

  1. VI全屏文本编辑器的命令总结
  2. 分析app和wap手机网站的不同
  3. diff 命令用法--如何打补丁【原创--学习笔记】
  4. 程序员面试金典——17.5珠玑妙算
  5. 李航《统计学习方法》第四章课后答案链接
  6. 简单电话系统的电话数量分析
  7. 一入python深似海--正則表達式
  8. 删除数组中重复的元素
  9. 序列化和反序列化(json和pickle)day18
  10. jQuery框架学习