Monthly Archives

2 Articles

ASP.net MVC 5 controller dependency injection with Microsoft Unity IoC Container

Downloadable source code

Dependency is just another object that a class needs to do its function.
For example, Main program calls a Service class lets say “Customer Class” to update a customer profile. The Customer class generate the required data and creates an instance of Database operations layer (Let’s say “CustomerOperations class”) to update the database tables. In this example, Customer class is dependent on CustomerOperations class to update a customer profile or CustomerOperations class is the dependency of Customer Class.

Read More

The type or namespace name system could not be found Error in C#

How to resolve “The type or namespace name system could not be found” and “Predefined type system object is not defined or imported” errors in a .Net project c#?

Install the latest version of System.Runtime Nuget package or add a reference to System.Runtime from “Add references”.

Clean and rebuild the project once Reference is added.

PM> Install-Package System.Runtime


Read More