Property Order
Namespace: Belay.Attributes
Assembly: Belay.Attributes.dll
Order
Gets or sets the order in which this setup method should be executed relative to other setup methods in the same class.
csharp
public int Order { get; set; }
Property Value
Examples
public class SensorArray : Device
{
[Setup(Order = 1)]
private async Task InitializeHardwareAsync()
{
// Initialize hardware first
await ExecuteAsync("setup_i2c_bus()");
}
[Setup(Order = 2)]
private async Task ConfigureSensorsAsync()
{
// Configure sensors after hardware is ready
await ExecuteAsync("configure_all_sensors()");
}
[Setup(Order = 3)]
private async Task StartDataCollectionAsync()
{
// Start collection after everything is configured
await ExecuteAsync("start_background_collection()");
}
}
Remarks
Use the Order property when you have multiple setup methods that must execute in a specific sequence. For example, hardware initialization should occur before loading configuration that depends on that hardware.