Sorting linked collection in Nhibernate query -
This is partly related.
I want to find a sequence of linked (HasMany) collections directly results in the Nurbinet query.
Icricetia criteria = session. Creatitaria (typef (portal page)); Homeland. Cratialius ("partial view", "vc"); Criteria.AddOrder (Order.Asc ("vc.ColumnNumber")); Criteria.Add (. Property.ForName ("URL") equation (PAGEURL)); Return criteria Inactive advertisements & lt; PortalPage & gt; (); Correcly generates one with a command but the result of the associated collection is not ordered.
After refunding the result, I would like to avoid sorting the collection (such as using linq for objects) Is this possible?
Update: As Steve suggested that the problem may be solved, the order feature in mapping works hard:
is equal to (x => x .PartialViews) .KolknameName Add ("PageID"). AsBag () SetAttribute ("Order-By", "Column Number");
Have you specified the collection type instead of a bag or a set ? If you make sure to use the list mapping type and specify an index column for list mapping, then everything should be taken care of for you.
See, and there is nothing, though this is the second one old
Major column =" id "/> gt; column column =" status "/> element gt;
Fluent mapping for this example would be:
is equal to (x = & Gt; x.Images). Essel (x = & gt; x.With the column ("position"));
Comments
Post a Comment