Registering a service using Autofac and getting the list of services via Container in MVC Controller

Using a DI framework (I am using Autofac in my case), you can register the services like below  in AutofacConfig.cs class inside Configure() method as below var builder = new ContainerBuilder(); builder.RegisterType<MyClass>().As<IMyInterface>(); Now you can loop through the list of services in the container .You can either get the entire list of services , or […]

Storing string with Enums in VB.Net

Below is one of the ways to store/retrieve   string data type using Enums . This is particularly useful in situations where  you have to deal with string values repeatedly in your project and don’t want to run into gotcha errors because you mistyped a string . Imagine an  Event logger  where you log multiple error […]

Web Forms vs. ASP.NET MVC

I am sure you landed to this post with  curious thoughts  about the differences and similarities between the web form architecture and mvc  architecture.What are the advantages of one over another ?Which  pattern should I use in my upcoming project? By the end of this article, you should find yourself in a better situation,if not […]