The text of this article is not in this database — only its details are. Read it on the old site: Implement Dependency Injection Using Autofac IoC Container
10 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.

Ammar ShaukatPosted Oct 8, 2023, 8:07 AM
Thanks for the nice share
Amit NaikPosted Apr 18, 2020, 7:42 AM
What is purppose of NotificationSender class, if we comment NotificationSender class and run the code we get same output..
ahmet urunPosted Jun 2, 2018, 10:30 AM
Instead of resolving instances of mobileService & mailService individually in the Main, you should've resolved notification class(of course after first registering it on the builder). This way the injection would be used for this example, otherwise it is just resolving registered classes. E.g. builder.RegisterType<NotificationSender>().PropertiesAutowired(); var notificationSender = container.Resolve<NotificationSender>(); notificationSender.SendNotification();
kiran IrabattiPosted May 23, 2018, 4:49 AM
Hello Sourav, I don't see any reference to class NotificationSender, is there any use or not?
akash pawarPosted Jun 5, 2017, 2:26 AM
You have not provided the detail explanation for this demo . Can you provide so that I will tell us how it works internally .
Rupesh KumarPosted Dec 17, 2015, 7:41 AM
nice article.
Sridhar SharmaPosted Nov 13, 2015, 12:23 AM
Very Nice article, I've executed your code and found that even after commenting NotificationSender class, the code got executed without any issues.
ashish fPosted Mar 13, 2015, 5:49 AM
check my question on Autofac http://stackoverflow.com/questions/29025491/how-do-i-use-autofac-instead-singleton-in-c
rad decPosted Jul 9, 2014, 11:47 AM
Nice article but you have not used the NotificationSender class ...
Former memberPosted Jun 9, 2014, 7:03 AM
Which Type of container is more optimal