I have looked at quite a few articles here, but none of them seem to be suitable for my case. If it helps or pertains to the issue, I am using ninjectMVC for dependency injection.
I have an Angular $http as such:
$http({
method: 'POST',
url: '/Lookup/GetChangeOptions/'
}).success(function (data) {
console.log(data);
var test = data;
//$scope.changeOptions = data;
}).error(function (jqXhr, textStatus, errorThrown) {
console.log(errorThrown);
});
Which calls my controller:
public class LookupController : Controller
{
private readonly ILookupService _lookupService;
public LookupController(ILookupService lookupService)
{
_lookupService = lookupService;
}
public JsonResult GetOtherIssues()
{
var otherIssues = _lookupService.GetOtherIssues();
return Json(otherIssues);
}
public JsonResult GetChangeOptions()
{
var changeOptions = _lookupService.GetChangeOptions();
return Json(changeOptions);
}
}
The call is giving me the error:
"System.MissingMethodException: No parameterless constructor defined for this object."
I am not sure what is causing the issue.. I have used similar structures in the past without any problems. Please let me know if I need to put the code of my service, but when I debug the call.. my break point in the controller is not even hit.