コード例 #1
0
        public IList ExecuteQuerywithMinParam(string query1, params object[] ParamList)
        {
            ISession session = _sessionFactory.GetCurrentSession();

            session.CacheMode = CacheMode.Ignore;
            session.FlushMode = FlushMode.Commit;
            var query = session.CreateSQLQuery(query1);

            if (ParamList != null)
            {
                for (int i = 0; i < ParamList.Count(); i++)
                {
                    query.SetParameter(i, ParamList[i]);
                }
            }
            var result = query.SetResultTransformer(Transformers.AliasToEntityMap).List();

            return(result);
        }