0

Is it possible to set the default order-by column to use in the NHibernate mapping file? Unless explicitly defined I want to order all specific entities by the Name column automatically.

I've seen that it can be done on collections but thats not what I'm after in this case.

Luke Smith
  • 23,504
  • 8
  • 29
  • 28

1 Answers1

1

No, that wouldn't make sense in the NHibernate mapping context because the order always depends on how you are doing the query; defining a "default order" would be pointless.

Instead, do that in a DAO/Repository base class.

Diego Mijelshon
  • 52,548
  • 16
  • 116
  • 154