# Class Sorting OptimaJet.Workflow.Core.Persistence.Sorting Specifies the field and direction used to sort a collection of records. Namespace: [OptimaJet.Workflow.Core.Persistence](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/) ```csharp public class Sorting ``` ## Properties `public string FieldName { get; }` Gets the name of the field used for sorting. `public SortDirection SortDirection { get; }` Gets the direction used for sorting. ## Methods `public static Sorting Create(string fieldName, SortDirection sortDirection = SortDirection.Asc)` Creates a [Sorting](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/Sorting/) instance for the specified field. ### Parameters | Name | Type | Description | | --- | --- | --- | | `fieldName` | `String` | The name of the field to sort by. | | `sortDirection` | `SortDirection` | The [SortDirection](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/SortDirection/) to apply. The default is [SortDirection.Asc](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/SortDirection/). | ### Returns | Type | Description | | --- | --- | | `Sorting` | A [Sorting](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/Sorting/) instance configured with `fieldName` and `sortDirection`. | [Previous SortDirection](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/SortDirection/) [Next TenantGlobalParameterApi](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Persistence/TenantGlobalParameterApi/)