When is the constructor of controller class is called and how? I'm asking this because in an application that I am maintaining, constructor of controller is passed with Interfaces of dlls and they appear to be automatically initialized by some deafult method in Dll. Contoller looks like this:
private _clientdetails
public CleintController(IClientDetails clientdetails)
{
_clientdetails = clientdetails
}
//here various members of clientdetails used via _clientdetails
This only appears to work when IClientdetails clientdetails
is passed as a param to constructor otherwise I get error: Type passed as var
. If I can see/know how constructor of controller is called, I can know how to pass this initialized interface to my other methods.