2011-09-26 14 views

Respuesta

7

tal vez hay una sintaxis más agradable posible, pero esto se debe hacer

var result = session.QueryOver<MyEntity>() 
    .Select(Projections.Alias(
     Projections.Conditional(Restrictions.Eq("type", 'a'), 
      Projections.Property(t => t.name), 
      Projections.Property(t => t.othername)), 
     "Name" 
    ) 
    .List(); 
Cuestiones relacionadas