Fluent Nhibernate Order-By on Collection

Posted by madcapnmckay on Stack Overflow See other posts from Stack Overflow or by madcapnmckay
Published on 2009-05-31T11:30:25Z Indexed on 2010/04/23 16:53 UTC
Read the original article Hit count: 290

Filed under:

Hi,

If I have a collection mapped in Fluent NHibernate and I want to apply an order to that collection how do I do that?

Eg:

HasMany(x => x.PastDates)
            .AsBag().Cascade
            .SaveUpdate()
            .KeyColumnNames.Add("EventId")
            .Where(e => e.DateFrom < DateTime.Now.Date)
            .Inverse();

I'm looking for the equivalent of the order-by attribute in HBM files.

Thanks

© Stack Overflow or respective owner

Related posts about fluent-nhibernate