Skip to content

feat: typed input/output access for lifecycle hooks#44

Merged
Theauxm merged 1 commit intomainfrom
feat/typed-lifecycle-access
Mar 26, 2026
Merged

feat: typed input/output access for lifecycle hooks#44
Theauxm merged 1 commit intomainfrom
feat/typed-lifecycle-access

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented Mar 26, 2026

Summary

  • Add GetInput<T>() and GetOutput<T>() on Metadata for typed access in global lifecycle hooks
  • Add TrainInput and TrainOutput properties on ServiceTrain<TIn, TOut> for zero-friction typed access in per-train hooks
  • 7 new tests covering typed access in OnCompleted, OnFailed, wrong-type fallback

Eliminates the need to capture input/output in private fields for use in lifecycle hooks. TrainInput is available in all hooks; TrainOutput is only available in OnCompleted.

Test plan

  • All 27 lifecycle override tests pass (20 existing + 7 new)
  • Zero build warnings
  • CSharpier formatted

Add GetInput<T>() and GetOutput<T>() on Metadata for typed access in
global lifecycle hooks, and TrainInput/TrainOutput properties on
ServiceTrain for zero-friction typed access in per-train hooks.
@Theauxm Theauxm merged commit 1d343b9 into main Mar 26, 2026
1 check passed
@Theauxm Theauxm deleted the feat/typed-lifecycle-access branch March 26, 2026 16:54
@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented Mar 26, 2026

This PR is included in version 1.28.0

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