Questions tagged [dependency-resolver]

71 questions
75
votes
6 answers

Wait for Angular 2 to load/resolve model before rendering view/template

In Angular 1.x, UI-Router was my primary tool for this. By returning a promise for "resolve" values, the router would simply wait for the promise to complete before rendering directives. Alternately, in Angular 1.x, a null object will not crash a…
shannon
  • 8,664
  • 5
  • 44
  • 74
35
votes
7 answers

Web Api Start up Exceptions with IDependencyResolver implementation

I am developing a Web Api and I decided to use custom DependencyResolver. I refer this [Dependency Injection for Web API Controllers] article. Everything is working well so far in the terms of dependency injection into controllers. Code snippet of…
25
votes
1 answer

How does Maven resolve SNAPSHOT dependencies when there are SNAPSHOTS with different timestamps in the local and the remote repository?

Say I have a project A in development that depends on project B - which is also currently in development and not yet released. So, in A's POM file, I have the following section: com.example
Christian
  • 6,070
  • 11
  • 53
  • 103
20
votes
4 answers

Autofac - The request lifetime scope cannot be created because the HttpContext is not available - due to async code?

Short Question: Same as this unanswered problem Long Question: I just ported some code over from an MVC 4 + Web Api solution that was using Autofac into my new solution which is also using Autofac but only with Web Api 2 (no MVC 5.1 project, just a…
parliament
  • 21,544
  • 38
  • 148
  • 238
15
votes
2 answers

IAuthorizationHandler with multiple registration - how the dependency resolver selects the right implementation?

Consider the following code in the ConfigureServices method of the Startup class - services.AddTransient(); services.AddTransient
atiyar
  • 7,762
  • 6
  • 34
  • 75
14
votes
2 answers

Asp.net mvc 4 dependency resolver

I am new to ASP.NET MVC 4. I have used a custom dependency resolver in my ASP.NET MVC 4 project in order to use Dependency injection framework. What is the role of dependency resolver in ASP.NET MVC 4 ?
Aslam Jiffry
  • 1,306
  • 6
  • 23
  • 57
11
votes
2 answers

Using ninject dependecyResolver for both MVC and WebAPI

I have created and MVC 4 web application and decided to use web api in this app. I'm using ninject dependency resolver for MVC web app. and now I want to use this ninject dependency resolver for web api. but the problem raise here mvc…
8
votes
3 answers

Cannot resolve import from index.ts from script located in same directory

I'm working on an angular 2 project written in TypeScript 2 and i'm currently facing an issue with the imports mechanism. Every sub-folder of my project has an "index.ts" file inside, that is exporting classes the said folder contains. So, in my…
kipy
  • 527
  • 4
  • 10
7
votes
0 answers

Why IDependencyResolver removed from ASP.NET Core and what should I use instead?

I'm using simple injector and I couldn't find IDependencyResolver in .net core 2, is it right choice to use IServiceProvider instead of using IDependencyResolver, since there is no "IDependencyScope BeginScope()" in IserviceProvider, I am bit…
5
votes
2 answers

Order when calling ResolveAll in Castle Windsor

Assume that I have multiple objects registered in the container, all implementing the same interface: container.Register( Component.For().ImplementedBy(), Component.For().ImplementedBy(), …
SaguiItay
  • 2,145
  • 1
  • 18
  • 40
4
votes
1 answer

System.web.Mvc DependencyResolver not able to create object for generic classes

I am trying to use dependencyinjection in Controller and using System.Web.MvcDependencyResolver.Current.GetService() for creating service instances in controller class. This works fine when Service Interfaces are non generic as below public…
4
votes
1 answer
3
votes
1 answer

Unity On-Demand Resolve of Interfce Properties

I have an interface IRDFReport and a base class BaseReport which implements that. The View and Report properties are heavy objects and should be resolving only when the report is actually being requested. I used two simple string suffix for finding…
Mohsen Afshin
  • 13,273
  • 10
  • 65
  • 90
3
votes
0 answers

Using DependencyResolver.GetService() inside UserManager.CreateAsync

I'm struggling with a problem when using DependencyResolver.GetService() inside a method called from UserManager.CreateAsync() in AspNet.Identity. I've added a UserProfile class to the AspNetUser according to this article. All works fine but when…
3
votes
1 answer

Resolving Unity Dependencies without a Unity.MVC

I have two projects that use the following Unity logic: container.RegisterType( new HierarchicalLifetimeManager(), new InjectionFactory( c => new MyDbContext(configurationService.MySqlConnectionString) …
Bern
  • 7,808
  • 5
  • 37
  • 47
1
2 3 4 5