title: nHibernate select query?
body: <p>I have an ado.net statement I want to convert to use NHibernate:</p>
  
  <pre><code>Dim sql As New StringBuilder()
  sql.AppendLine("SELECT r.RoleId,  r.RoleName ")
  sql.AppendLine("FROM dbo.aspnet_Roles r ")
  sql.AppendLine("WHERE r.RoleId IN ")
  sql.AppendLine(" (select roleID from dbo.MenuRole where menuId = @MenuId) ")
  sql.AppendLine("Order By r.RoleName")
  </code></pre>
  
  <p>later, I populate the parameter with:
              cmd.Parameters.AddWithValue("@MenuId", menuId)</p>
  
  <p>Considering I want to return an: IList(Of AspnetRole)</p>
  
  <p>and I'm using:</p>
  
  <pre><code>Dim managerFactory As IManagerFactory = New ManagerFactory()
  Dim roleManager As IAspnetRoleManager = managerFactory.GetAspnetRoleManager()
  </code></pre>
  
  <p>How do I build and use that query with nHiberate?</p>
  
  <p>(P.S. I am using Codesmithtools and VB.net and VS2008 and SQL Server 2008)</p>