unitycontainer / aspnet-webapi

Unity.AspNet.WebApi package
Apache License 2.0
9 stars 11 forks source link

Add custom filter provider #8

Open mika76 opened 6 years ago

mika76 commented 6 years ago

This is great for controllers but does not work for custom filters and if you add a dependency in your custom filter (property injection) it never get's resolved.

The only way I figured out how to do this was from https://michael-mckenna.com/dependency-injection-for-asp-net-web-api-action-filters-in-3-easy-steps/ where he creates a custom UnityFilterProvider. This is so benificial I'm not sure why it's not in this package...

ENikS commented 6 years ago

I would be happy to add it if someone creates a pull request. Make sure you add some testing as well.