Skip to content

Conversation

@kylejuliandev
Copy link
Contributor

This PR

In #512 I needed to tweak the sample AspNetCore application to pass Hook options to the MetricsHook. I noticed that in order to pass the options I needed to use the delegate based approach, while discarding the serviceProvider, like:

featureBuilder.AddHostedFeatureLifecycle()
        .AddHook(_ => new MetricsHook(metricsHookOptions))

It would be simpler and easier for devs to interact with a third overload that allows them to pass an instance of the hook that they want to interact with, like so:

featureBuilder.AddHostedFeatureLifecycle()
    .AddHook(new MetricsHook())

Related Issues

Notes

Follow-up Tasks

How to test

Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
@kylejuliandev kylejuliandev requested a review from a team as a code owner July 6, 2025 12:58
@codecov
Copy link

codecov bot commented Jul 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.39%. Comparing base (929fa74) to head (07e174b).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #513      +/-   ##
==========================================
+ Coverage   87.35%   87.39%   +0.04%     
==========================================
  Files          47       47              
  Lines        1827     1833       +6     
  Branches      190      190              
==========================================
+ Hits         1596     1602       +6     
  Misses        188      188              
  Partials       43       43              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@askpt askpt requested review from a team July 7, 2025 14:08
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
@askpt askpt enabled auto-merge July 14, 2025 17:55
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.

4 participants