I am having a simple Demo controller, but when it' s called, i have the error : "Make sure that the controller has a parameterless public constructor."
It seems to me that my code is fine:
public class DemoController : ApiController
{
#region [ Global Variable Declarations ]
private String ConnectionString = String.Empty;
public UsersWSRepo urws;
MailHelper MH;
SubscriptionWSRepo sr;
#endregion
#region [ Constructor Initialization ]
public DemoController()
{
urws = new UsersWSRepo(GlobalConstants.DBConn());
sr = new SubscriptionWSRepo(GlobalConstants.DBConn());
this.MH = new MailHelper();
}
#endregion
}
Don' t understand where the problem comes from as it works on my other web mvc project.
what does it means make sure that the controller has a parameterless public constructor ? does it means parameters are not alowed on a webapi heritate controller ?