sankeerth m

sankeerth m

  • 1.7k
  • 460
  • 9.1k

Null Reference exception object reference not set to instance of an ob

May 28 2021 11:24 AM
public bool OptionExists(int id)
{
return _context.Option.Any(e => e.OptionID == id);
//var city = AggregateOptionExists.GetAggregateOption(id);
//if (city == null)
// {
// return NotFound();
// }
// return city;
}
 
 
I am having null values in Db how to handle null reference exception at _context.Option 

Answers (2)