How Can I use GroupBy and OrdeBy in my Queries?

 I would like to use GroupBy or OrderBy with the following script, I searched about this but didn't find anything.

Dim jobQr = Query.From(Table.Person).Select("PersonalTitle").Where("IsInActive = 0 and IsExternal = 0 and IdentityType = 'Primary'")
Dim jobR = Session.Source.GetCollection(jobQr, EntityCollectionLoadType.Slim)

Can you help me?

Parents
  • For grouping you find a code snippet in the snippet library of the code editor in Designer or Object Browser. Just press F2 (or choose the snippet icon from the toolbar) and select Object layer | Collections | Group collections by column

    For sorting a collection you can use the .OrderBy method in your fluent query definition.

    For example:

    Dim jobQr = Query.From(Table.Person).Select("PersonalTitle").Where("IsInActive = 0 and IsExternal = 0 and IdentityType = 'Primary'").OrderBy("PersonalTitle")
    Dim jobR = Session.Source.GetCollection(jobQr, EntityCollectionLoadType.Slim)

Reply
  • For grouping you find a code snippet in the snippet library of the code editor in Designer or Object Browser. Just press F2 (or choose the snippet icon from the toolbar) and select Object layer | Collections | Group collections by column

    For sorting a collection you can use the .OrderBy method in your fluent query definition.

    For example:

    Dim jobQr = Query.From(Table.Person).Select("PersonalTitle").Where("IsInActive = 0 and IsExternal = 0 and IdentityType = 'Primary'").OrderBy("PersonalTitle")
    Dim jobR = Session.Source.GetCollection(jobQr, EntityCollectionLoadType.Slim)

Children