QueryOver.Of 查询方式 离线查询 联合查询

//maindocid
 var query = QueryOver.Of<Maindoc>().Where(p => p.DocType == (int)doctype).JoinQueryOver<Users>((doc) => doc.Creator).Where(p => p.Id == curLoginUserID).Select(p => p.Id);
 return this.GetList<Maindoc>(args, Subqueries.WhereProperty<Maindoc>(p => p.Id).In(query), true);

table

  public partial class Maindoc 
    {
        public virtual int Id { get; set; }
        public virtual int DocType { get; set; }
        public virtual Users Creator { get; set; }
    }

猜你喜欢

转载自blog.csdn.net/lemonemmm/article/details/90106178