I am developing an application in asp.net MVC 2.0 in which I am calling the function of Repository in controller but it is giving me an exception of Object reference not set to an instance of an object and Its not allowing me to debug this line so I am unable to find the Problem. Here is the code.
private IIssueRepository _issueRepository;
public double CalculateLoadBar(long userID)
{
int i = 0;
double load = 0;
var issues = _issueRepository.GetAssignedIssues(userID);
}
Please tell me how to trace out the problem. Thanks
From what you posted, it appears that
_issueRepositoryis not set to an object – it is not instantiated anywhere.It needs to be instantiated before you can call methods on it.