Base solution for your next web application
Open Closed

How To "ILogger" in ActionFilter of mvc or web api? #878


User avatar
0
wddpct created

I found I can't inject “ILogger” as usual, there is no inject point in actionfilter, can you help me to solve it out


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    You can use IocManager.Instance.Resolve... (see document: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Dependency-Injection#DocIocHelper">http://www.aspnetboilerplate.com/Pages/ ... cIocHelper</a>)

    Or you can use dependency injection and create filter like that: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp.Web.Api/WebApi/AbpWebApiModule.cs#L82">https://github.com/aspnetboilerplate/as ... ule.cs#L82</a>