Skip to content

fix: return the schedule builder from job settings so README chains compile - #7

Merged
jacalapa merged 1 commit into
mainfrom
fix/fluent-job-builder
Nov 11, 2026
Merged

jacalapa merged 1 commit into
mainfrom
fix/fluent-job-builder

Conversation

@jacalapa

Copy link
Copy Markdown
Contributor

Problem

AsTransactional, WithPriority, WithRetryDelaysInSeconds and WithTimeout return IJobBuilder<T>, which has no ScheduleAsync / SetRecurrenceAsync. The chains in the README ("Scheduling options", "Outbox pattern") therefore fail to compile:

error CS1061: 'IJobBuilder<SendEmailJob>' does not contain a definition for 'ScheduleAsync'

Fix

IScheduleJobBuilder<T> and IRecurringJobBuilder<T> declare the four settings again (new) with their own return type, so a chain can end with ScheduleAsync / SetRecurrenceAsync. Backward compatible: code written against IJobBuilder<T>, e.g. the configure callback of IHost.SetRecurrenceAsync, keeps working.

Tests

FluentJobBuilderTests uses the README chains as written, through the public IScheduler, and checks that the settings reach the stored job (priority, retries, timeout, transactional / outbox, scheduled time, recurrence). Without the fix the file does not compile (same CS1061), so the README examples are now guarded by the build.

All 66 unit tests pass on net8.0, net9.0 and net10.0.

Note

Independent of #8 (fix/recurrence-update); the two branches merge without conflicts. A patch release (2.0.1) would let users drop the workaround of keeping the builder in a variable.

🤖 Generated with Claude Code

…ompile

AsTransactional, WithPriority, WithRetryDelaysInSeconds and WithTimeout returned
IJobBuilder<T>, which has no ScheduleAsync / SetRecurrenceAsync, so the chains in
the README ("Scheduling options", "Outbox pattern") failed with CS1061.

IScheduleJobBuilder<T> and IRecurringJobBuilder<T> now declare the settings with
their own return type. Code written against IJobBuilder<T> (e.g. the
SetRecurrenceAsync configure callback) keeps working. The new tests use the README
chains as written, so they stop compiling if this breaks again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jacalapa
jacalapa merged commit 388ea70 into main Nov 11, 2026
3 checks passed
@jacalapa
jacalapa deleted the fix/fluent-job-builder branch November 11, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant