随笔分类 - ORM
摘要:1. 自定义非受管实体类namespace IOT{ public class CustomerProjection{ public int ID = 0; public string Name = ""; public CustomerProjection(int id, string name){ ID = id; Name = name; } }}2. 在实体类属性添加对自定义非受管实体类的引入[Imprt(typeof(IOT.CustomerProjection), "CustomerProjection")][ActiveRecord...
阅读全文
摘要:1 表列如果你的列名是数据库的保留字,在Property中用"`"声明列名[Property("`User`")]public String User{ get { return _user; } set { _user = value; }}不要使用Status做列名,它是NHibernate的保留字,否则ActiveRecord会抛异常:Ambiguous column name 'Statu...
阅读全文

浙公网安备 33010602011771号