我在应用程序中使用Castle Windsor,我想在ExceptionFilterAttribute中使用注入一些服务示例ILog:
public class GenericExceptionFilterAttribute : ExceptionFilterAttribute
{
private readonly ILog _logger;
public GenericExceptionFilterAttribute()
{
}
public GenericExceptionFilterAttribute(ILogManager logManager)
{
_logger = logManager.GetLogger(typeof(GenericExceptionFilterAttribute));
}
}
Run Code Online (Sandbox Code Playgroud)
我如何在该课程中注入服务?
问候
卡洛斯
c# dependency-injection castle-windsor inversion-of-control asp.net-web-api