The latest drop allows contextual injection with an overload to the Map
method that allows you to pass in a different service locator. Great for
contextual injection!
On Thursday, February 9, 2012, Mathias Stenbom <math
...@stenbom.com> wrote:
> I think this might be the same problem, which iv posted on SO about;
http://stackoverflow.com/questions/8243135/autofac-asp-net-mvc-3-http...
> Did you find any solution? (English please )
> Regards,
> Mathias
> On Wed, Feb 8, 2012 at 10:39 PM, Fabio Miceli <fbo.mcl...@gmail.com>
wrote:
> grazie infinite per il tuo suggerimento......vedrņ di studiarci per
capire bene.
> a risentirci
> 2012/1/24 Fernando Mondo <fernando.mo...@gmail.com>
> i forgot error:
> "No scope with a Tag matching 'httpRequest' is visible from the scope in
which the instance was requested. This generally indicates that a component
registered as per-HTTP request is being reqested by a SingleInstance()
component (or a similar scenario.) Under the web integration always request
dependencies from the DependencyResolver.Current or
ILifetimeScopeProvider.RequestLifetime, never from the container itself."
> 2012/1/24 fernando mondo <fernando.mo...@gmail.com>
> I have a Asp.Net Mvc3 Site and I wish to know how to inject
> HttpContextbase in the TestConverter?
> the unitOfWork works, but with the httpContext the error
> public class TestConverter: ITypeConverter<ClientModel, Client>
> {
> private readonly IUnitOfWork _unitOfWork;
> private readonly HttpContextBase _httpContext;
> public TestConverter(IUnitOfWork unitOfWork/*,
> HttpContextBase httpContext*/)
> {
> _unitOfWork = unitOfWork;
> // _httpContext = httpContext;
> }
> public Client Convert(ResolutionContext context)
> {
> var clientModel = context.SourceValue as ClientModel;
> return new Client(ClientModel.Name,
> httpContext.Request["Origin"]);
> }
> global.asax
builder.RegisterAssemblyTypes(assemblies).AssignableTo<Profile>().As<Profil e>();
> var container = builder.Build();
> Mapper.Initialize(c =>
> {
> c.ConstructServicesUsing(container.Resolve);
> profiles.ToList().ForEach(c.AddProfile);
> });
> Myprofile
> protected override void Configure()
> {
> CreateMap<ClientModel,
> Client>().ConvertUsing<TestConverter>();
> }
> --
> You received this message because you are subscribed to the Google Groups
"AutoMapper-users" group.
> To post to this group, send email to automapper-users@googlegroups.com.
> To unsubscribe from this group, send email to
automapper-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/automapper-users?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
"AutoMapper-users" group.
> To post to this group, send email to automapper-users@googlegroups.com.
> To unsubscribe from this group, send email to
automapper-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/automapper-users?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
"AutoMapper-users" group.
> To post to this group, send email to automapper-users@googlegroups.com.
> To unsubscribe from this group, send email to