Class EntityRankOrderer
Helper method for sorting items in a table EntityRankOrderer. Method will take care of gaps and duplicate values by ordering all rows starting from 1 It will only update rows having actual changes
Inherited Members
Namespace: SuperOffice.CRM.Entities
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public static class EntityRankOrderer
Methods
SetItemPositionAsync(FieldInfo, int, int, CancellationToken)
Re-order items in a table, based on some int rank/sortorder field
Declaration
public static Task SetItemPositionAsync(FieldInfo orderField, int pkToMove, int newPosition, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo | orderField | The field that is used to order the items |
| int | pkToMove | The primary key of the item to be moved |
| int | newPosition | The new position (1-based) of the item to be moved |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |