您的位置:首页 > 数据库

.net 映射数据库操作--自定义属性忽略字段

2011-03-14 14:44 288 查看
1.自定义属性类:

public class ModelPropertyAttribute : Attribute

{

bool nottablecolum;

public bool NotTableColumn { get { return this.nottablecolum; } }

public ModelPropertyAttribute(bool nottablecolums)

{

this.nottablecolum = nottablecolums;

}

public override string ToString()

{

return nottablecolum ? "nottablecolum" : "";

}

}

2.需要属性,但不属于数据库字段的时候使用

[Common.Model.ModelProperty(true)]

public decimal SendValue

{

get{ }

set{ }

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐