Gentle.NET Attribute
------------------------------------------------------------
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相关推荐
- 【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](7)
[论文阅读]A Gentle Introduction to Graph Neural Networks [图神经网络入门](7) Into the Weeds Other types of grap ...
- 【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](6)
[论文阅读]A Gentle Introduction to Graph Neural Networks [图神经网络入门](6) GNN playground Some empirical GNN ...
- 【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](5)
[论文阅读]A Gentle Introduction to Graph Neural Networks [图神经网络入门](5) Graph Neural Networks 图神经网络 Now th ...
- 【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](4)
[论文阅读]A Gentle Introduction to Graph Neural Networks [图神经网络入门](4) The challenges of using graphs in ...
- 【论文阅读】A Gentle Introduction to Graph Neural Networks [图神经网络入门](1)
[论文阅读]A Gentle Introduction to Graph Neural Networks [图神经网络入门](1) 最近读了一篇Distill网站上的一篇文章,讲的是图神经网络的入门, ...
- Gentle中的数据表实体类相关自定义属性的设置和获得
1.自定义 表名属性 TableNameAttribute 2.自定义 主键属性 PrimaryKeyAttribute 3.自定义 列名属性 TableColumnAttribute 4.数据表pe ...
- Gentle.NET 使用文档
------------------------------------------------------------ 概述 ------------------------------------ ...
- Python错误:AttributeError: 'generator' object has no attribute 'next'解决办法
今天在学习生成器对象(generation object)运行以下代码时,遇到了一个错误: #定义生成器函数 def liebiao(): for x in range(10): yield x #函 ...
- Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
最近安装项目到自己oppo手机上提示Error:warning: Ignoring InnerClasses attribute for an anonymous inner class,但是在模拟机 ...
最新文章
- kaggle、TDS、arXiv等,我最喜欢的数据科学资源
- form表单会跨域_前端跨域So Easy
- android连接sqlite进行简单的增删改查和事务管理
- python3学习笔记一(标识符、关键字)
- local_irq_disable
- 每日一题:leetcode1128.等价多米诺骨牌对数
- 累积分布函数_C7: 概率函数和分布函数Distribution Function
- python数据库操作sqlite_使用Python对SQLite数据库操作
- Snabbdom(虚拟dom-4-init函数)
- 安装了dns且可以正常工作为什么还有没有可以使用的DNS服务器的错误
- 面对行业难题,华为云邀请物联网全行业拿出“亮剑”精神
- 算命大仙的黄金时代?一年轻松赚5亿…..
- 苹果智能音箱HomePod跳票了,上市日期推迟到明年
- 九、索引与执行计划、索引的分类
- 5.mybatis实战教程(mybatis in action)之五:与spring3集成(附源码)
- ICMP(网际控制报文协议)
- 带SN切换流程_一文详解贴片电阻生产工艺流程(15个步骤)
- c语言课程设计找出肇事车牌,C语言课程设计参考题目.doc
- 小程序嵌套H5的方式和技巧
- 费马大定理 超级计算机,数学专业经典读物
热门文章
- 7-14 与数据库相连
- [Step By Step]SAP HANA PAL多项式回归预测分析Polynomial Regression编程实例FORECASTWITHPOLYNOMIALR(预测)...
- 我的Linux笔记5--我要连网
- IBM Racetrack内存为移动设备带来1TB容量
- python 画图--简单开始及折线图
- Leetcode 687.最长同值路径
- 【机器学习】集成算法使用样例
- WTA (winner-take-all) 与 自组织映射 SOM (self organizing map)的理解
- 问题:Cannot assign a device for operation Variable
- 【Oracle】进阶知识进一步了解