ipjohnson / Grace

Grace is a feature rich dependency injection container library
MIT License
337 stars 33 forks source link

Support for MVC WebApi2 with OWIN #97

Closed darkcamper closed 5 years ago

darkcamper commented 7 years ago

Hi @ipjohnson !

I know there is an adapter for using Grace with Asp.net Core. How about adding integration for OWIN based MVC Web Api 2? It would be great for selfhosted services when you are still not able to make the jump to NET Core.

ipjohnson commented 7 years ago

Hi @darkcamper

I definitely like the idea but unfortunately I'm going to be strapped for time in the coming weeks so I won't be able to under take this for a bit. I'm 100% positive it will work as Grace supports MVC 5 and I have a couple MVC apps that use owin and create new scopes and resolve from them.

Are you looking to start a project now?

darkcamper commented 7 years ago

I'm going to start a new project that could make use of it in a couple of weeks.

It doesn't seem too difficult, at least at a basic level with just the IDependencyResolver (which might suffice for the moment). So I think I'll give it a try and tell you about the results.

ipjohnson commented 7 years ago

@darkcamper what did you end up doing for this?

darkcamper commented 7 years ago

@ipjohnson I currently have a working solution based on creating named scopes per request. I think it's still a bit rough so I'll have to do some refactoring and cleaning before uploading it to github / nuget (maybe this weekend I could find some time).

Is there any naming convention for grace related packages made by third parties? (just to be consistent with other packages)

ipjohnson commented 7 years ago

@darkcamper sorry I thought I replied to this earlier but apparently didn't. (WhatEverYouWant).Grace.Owin seems reasonable. What are your thoughts?

ipjohnson commented 5 years ago

closing due to inactivity