Feedback on ASP.NET Web API

Support Depenedency Injection on MessageHandlers

Support Depedency Injection for MessageHandlers by resolving the message handlers out of the ServiceResolver or providing a MessageHandlerFactory similar to the old WebApiConfiguration.MessageHandlerFactory.

42 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Anonymous shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    declined  ·  Daniel Roth responded  · 

    Web API doesn’t control creating the message handler instances – you create them and then add them to the configuration – so you should be able to wire up DI for message handlers yourself.

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Mohamed Benothmane commented  ·   ·  Flag as inappropriate

        Yes we definitely need this feature since we need to handle authentication using message handlers where we need repository injected in the message handler itself.

      Feedback and Knowledge Base