NHibernate 中Not的使用方法

public virtual EmployeeJoinInfo GetEmployeeJoinByWorkCode(string workCode)
        {
            using(ISession session = OpenSession())
            {
                IList list = session.CreateCriteria(typeof(EmployeeJoinInfo)).Add(Expression.Eq("WorkCode", workCode)).Add(Expression.Not(Expression.Eq("ExecStatus",ExecuteStatus.Executed))).List();
                if(list.Count>0)
                {
                    return (EmployeeJoinInfo)list[0];
                }
            }
            return null;
        }

 

posted @ 2012-08-29 23:07  Tom Fan  阅读(243)  评论(0编辑  收藏  举报