Because LogException
is implemented explicitly, you have to cast to IExceptionLogger
before calling it:
public ActionResult Index(ExceptionDetail exceptionDetail)
{
((IExceptionLogger)exceptionDetail).LogException();
return View(exceptionDetail);
}
To make it work without casting, implement method implicitly:
void LogException(ExceptionDetail exceptionDetail)
{
}