KestrunTaskService.Create method
Creates a task from a code snippet without starting it.
public string Create(string? id, LanguageOptions scriptCode, bool autoStart, string? name,
string? description = null)
| parameter | description |
|---|---|
| id | Optional unique task identifier. If null or empty, a new GUID will be generated. |
| scriptCode | The scripting language and code configuration for this task. |
| autoStart | Whether to start the task automatically. |
| name | Optional human-friendly name of the task. |
| description | Optional description of the task. |
Return Value
The unique identifier of the created task.
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | Thrown if scriptCode is null. |
| InvalidOperationException | Thrown if a task with the same id already exists. |
See Also
- record LanguageOptions
- class KestrunTaskService
- namespace Kestrun.Tasks