var surveyResultItem = _mcniDbContext.SurveyResultsLines.Where(e => e.SurveyOptionId == deleteOption.SurveyOptionId).ToList();
Where my Dbmodel is _mcniDbContext
and SurveyResultsLines
is my classin it. I have checked that value is not null for deleteOption and SurveyOptionId is present in both of them. There no red line in my code but while running it. it gives error:
Error Message: Object reference not set to an instance of an object.
Exception Trace: System.NullReferenceException: Object reference not set to an instance of an > object. at MCNIDev.Processor.Services.SurveyProcessor.CheckSurveyResultsLines(SurveyQuestions deleteQuestion, SurveyOptions deleteOption) in D:\Projects\mcninew\MCNIDev\MCNIDev\Processor\Services\SurveyProcessor.cs:line 383