2011-09-26 16 views

risposta

7

forse c'è possibile una sintassi più bello, ma questo dovrebbe fare

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(); 
Problemi correlati