zcz527 / autofac

Automatically exported from code.google.com/p/autofac
Other
0 stars 0 forks source link

Expose lifetime scope tags for MVC integration. #466

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be preferable to do this in a consistent way across all three 
integrations.

Original issue reported on code.google.com by alex.meyergleaves on 4 Nov 2013 at 7:21

GoogleCodeExporter commented 8 years ago
It looks like Web API already has 
AutofacWebApiDependencyResolver.ApiRequestTag, and Web has WebLifetime.Request.

Original comment by alex.meyergleaves on 4 Nov 2013 at 7:29

GoogleCodeExporter commented 8 years ago
Since the constant is always "AutofacWebRequest" (presumably so you can 
register things across API types and still have "per-request" semantics) I 
wonder if this might be something to push to a central class.

Maybe something like an Autofac.Web assembly (not Autofac.Integration.Web since 
that's web forms). The idea being that the Autofac.Web assembly would have:
* The lifetime scope constant.
* Extensions for registering things on a per-request basis (so we don't have 
"InstancePerHttpRequest" scattered all over and repeated since it does the same 
thing).

I don't know what else it might have, but there is a push to unification of the 
ASP.NET platform (Microsoft.AspNet.*) and things all work together; it'd make 
sense we have a base dependency with common stuff just like they do.

Original comment by travis.illig on 6 Dec 2013 at 12:29

GoogleCodeExporter commented 8 years ago
This feature would be great for WCF-integration as well, we expose WCF enpoints 
from our MVC web-application, and have to register components by 
InstancePerLifetimeScope and not intsancePerHttpRequest since 
ServiceHostFactory resolves from "Container" lifetimescope and not current 
request scope.

Since there are a request in both cases it would be great to do registration 
"per request" regardsless if WCF request or "MVC" request.

Original comment by nikko...@gmail.com on 10 Feb 2014 at 10:03

GoogleCodeExporter commented 8 years ago
Moved issue to GitHub: https://github.com/autofac/Autofac/issues/466

Subsequent issue management will be held there; closing the issue on Google 
Code as "WontFix" because we will handle issue resolution on GitHub.

Original comment by travis.illig on 11 Feb 2014 at 12:03