title: Projections in NHibernate
body: <p>suppose in an entity there are attributes id, username, age, address. Now I just want id and username and I use this code for it.</p>
  
  <p>Projections enable the returning of something other than a list of entities from a query.</p>
  
  <pre><code>var proj = Projections.ProjectionList()
      .Add(Projections.Property("Id"), "Id")
      .Add(Projections.Property("Username"), "Username");
  
  var list2 = DetachedCriteria.For&lt;User&gt;()
      .Add(Expression.Eq("Username", "lachlan"))
      .GetExecutableCriteria( sessionFactory.GetCurrentSession())
      .SetProjection( proj )
      .List();
  </code></pre>
  
  <p>How will I retrieve the values. In which object will these value be taken.</p>