我正在开发一个ASP.net MVC应用程序,我有一个控制器ExceptionController
用于显示在我的应用程序中捕获的异常。调用接口方法C#
这种控制器实现一个接口IExceptionLogger
public class ExceptionController : Controller, IExceptionLogger
{...}
具有一个方法void LogException(ExceptionDetail exceptionDetail);
我已经实现了ExceptionController
太内部的方法。
void IExceptionLogger.LogException(ExceptionDetail exceptionDetail)
{...}
现在我需要从ExceptionController
的作用Index
调用该方法LogException()
。
public ActionResult Index(ExceptionDetail exceptionDetail)
{
// Method must be called here
return View(exceptionDetail);
}
我该怎么做?
'LogException(exceptionDetail);' ? – zerkms
我会尝试调用那里的方法,看看会发生什么... –
是否有任何原因明确地实现了接口? –