I have the controller, where I am doing the DI. I have 1 constructor with Interface Injected. Hence I have created a Default constructor with out any parameter. (Because if we don't do this then Issue comes as "Make sure that the controller has a parameterless public constructor")
I have the below parametezied constructor:
private IDAL DAL;
private IBLL BLL;
public ABCController(IDAL DalLayer, IBLL BllLayer)
{
DAL = DalLayer;
BLL = BllLayer;
}
How to call this constructor in the below parameter-less constructor? I have used :this()
, but here the issue is throwing DalLayer,BllLayer are undefined. Because those were declared in the other constructor:
public ABCController():this(DalLayer,BllLayer)
{
}
How to resolve the issue?