In web api setup the parameterized constructor AssignmentController(ProfileConfigCAWP pc)
is getting called. I need to stop this.
I'm not trying to invoke parameterized .ctor one. Neither Web API pipleline will do, as IMHO web API pipeline will instantiate parameterless .ctor, (unless depency injection comes into picture, which in my case I am not passing
ProfileConfigCAWP
, anywhere right now.
public class BaseApiController : ApiController
{
//1st call
public BaseApiController()
{
}
}
//Web Api Controller
public class AssignmentController : BaseApiController
{
public AssignmentController()
{
}
//2nd call
public AssignmentController(ProfileConfigCAWP pc)
{
//Why does this gets invoked, I'm worried Unity Container depency injection, is playing around
if (pc != null && pc.LoggedinAccountId != Guid.Empty)
{
CAWPConfigure(pc);
}
}
}
Even I tried tweaking with base keyword
so that base would explicitly know which constructor to call back.
public class BaseApiController : ApiController
{
//1st call
public BaseApiController()
{
}
}
//Web Api Controller
public class AssignmentController : BaseApiController
{
public AssignmentController() : base()
{
}
//2nd call
public AssignmentController(ProfileConfigCAWP pc) : this()
{
//Why does this gets invoked, I'm worried Unity Container depency injection, is playing around
if (pc != null && pc.LoggedinAccountId != Guid.Empty)
{
CAWPConfigure(pc);
}
}
}
EDIT:
I'm not trying to invoke parameterized .ctor one. Neither Web API pipleline will do, as IMHO web API pipeline will instantiate parameterless .ctor, (unless depency injection comes into picture, which in my case I am not passing ProfileConfigCAWP
, anywhere right now.