Skip to content

Instantly share code, notes, and snippets.

@orhanveli
Created December 14, 2011 19:16
Show Gist options
  • Save orhanveli/1478021 to your computer and use it in GitHub Desktop.
Save orhanveli/1478021 to your computer and use it in GitHub Desktop.
Nhibernate distinct by specific column example
crit.SetProjection(
Projections.Distinct(
Projections.Alias( Projections.Property("SourceName"), "SourceName" )
)
);
crit.SetResultTransformer( new NHibernate.Transform.AliasToBeanResultTransformer(typeof(CMSNews)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment