TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sivaji Tata
NA
159
5.4k
Dependency injection is not working
Mar 8 2021 8:13 AM
Hi, I tried to access the services in the home controller but somehow it's not working
Startup.cs
public
void
ConfigureServices(IServiceCollection services){
/*boilerplate's default bindings*/
services.AddTransient<IDummy, Dummy>(p =>
new
Dummy()
{
name =
"from injection"
});
}
HomeController.cs
public
IActionResult Index(IDummy dummy){
var test = dummy.name;
return
this
.View(HomeControllerAction.Index);
}
Reply
Answers (
1
)
Dataset in asp.net mvc
About Ajax Send Request