Skip to content

Commit

Permalink
docs: Added complex example
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Oct 19, 2024
1 parent 1749a38 commit b486170
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/features/model-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,20 @@ Services.AddNCronJob(options =>
.ExecuteWhen(success: s => s.RunJob<JobC>());
});
```

## Construct complex dependencies
You can construct complex dependencies by using a combination of `AddJob` and `ExecuteWhen` methods. Here an example:

```
Job A -> Job B -> Job C
```

This can be achieved by:

```csharp
Services.AddNCronJob(options =>
{
options.AddJob<JobA>().ExecuteWhen(success: s => s.RunJob<JobB>()
.AddJob<JobB>().ExecuteWhen(success: s => s.RunJob<JobC>());
});
```

0 comments on commit b486170

Please sign in to comment.