Exemplo n.º 1
0
        public IList <T> ExecuteSql <T>(string sql)
        {
            ISQLQuery sqlQuery = Sessao.CreateSQLQuery(sql);

            sqlQuery.SetResultTransformer(NHibernate.Transform.Transformers.AliasToBean <T>());

            return(sqlQuery.List <T>());
        }
Exemplo n.º 2
0
        public void ExecuteProcedure(string procedure, Dictionary <string, object> parameters = null)
        {
            ISQLQuery sqlQuery = Sessao.CreateSQLQuery(procedure);

            if (parameters != null)
            {
                foreach (var item in parameters)
                {
                    sqlQuery.SetParameter(item.Key, item.Value);
                }
            }

            sqlQuery.ExecuteUpdate();
        }
Exemplo n.º 3
0
        public IList <T> ExecuteSql <T>(string sql, Dictionary <string, object> parameters = null)
        {
            ISQLQuery sqlQuery = Sessao.CreateSQLQuery(sql);

            if (parameters != null)
            {
                foreach (var item in parameters)
                {
                    sqlQuery.SetParameter(item.Key, item.Value);
                }
            }

            sqlQuery.SetResultTransformer(NHibernate.Transform.Transformers.AliasToBean <T>());

            return(sqlQuery.List <T>());
        }