NHibernate HQL很慢?

时间:2016-03-05 20:29:51

标签: c# nhibernate

我正在尝试创建一个HQL查询来从表中获取所有结果,该表只有一条记录,而查询返回结果的速度非常慢。

我怎样才能让这个回报更快?

试图

public class PerfilDAO : GenericDAO<Perfil> 
{
    public IList<Perfil> findAll() 
    {
        ISession _session = DBConnect.openSession();
        IList<Perfil> list = _session.CreateQuery("FROM Perfil p ORDER BY p.descricao")
                                     .SetCacheable(true)
                                     .List<Perfil>();
        return list;
    }
}

0 个答案:

没有答案
相关问题