Click here to Skip to main content
15,906,329 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

can any body will suggest me where i am doing wrong to use dependency injection.

When i am going to define parameterized constructor then my application is running but not invoking any Controller action Method.

bellow code ..

without defining constructor application is executing controller action method.
so can any one please guide me where i am doing mistake.

What I have tried:

services.AddScoped<IUser, User>();

IUser<UserData> repository;

       public ValuesController(IUser<UserData> o)
           repository = o;
Updated 21-Mar-16 0:39am

1 solution

Hi please look into these links below for your help:
thanks in advance

ASP.NET 5 MVC6 Dependency Injection in 6 Steps | .NET Liberty[^]

Dependency Injection &mdash; ASP.NET documentation[^]
Share this answer
Member 11414035 21-Mar-16 6:35am    
I also have the same problem in code. Thanks for help.. +5
pawan Jha1988 21-Mar-16 7:18am    
Still getting the same issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900