Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autofac filter interface example not available #19

Closed
c-arnab opened this issue Sep 17, 2016 · 1 comment
Closed

Autofac filter interface example not available #19

c-arnab opened this issue Sep 17, 2016 · 1 comment

Comments

@c-arnab
Copy link

c-arnab commented Sep 17, 2016

The documentation (http://docs.autofac.org/en/latest/integration/webapi.html) still shows the old style and is not updated. Would appreciate if someone could help me with changing the below code to new style.

public void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            if (actionExecutedContext.Response != null)
                actionExecutedContext.Response.Headers.Add("P3P", "CP=\\\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\\\"");

        }

        public void OnActionExecuting(System.Web.Http.Controllers.HttpActionContext actionContext)
        {

        }

registering the same..

builder.Register(c => new myActionFilter())
            .AsWebApiActionFilterFor<DefaultController>(c => c.myaction(default(myclass)))
            .InstancePerRequest();

Thanks

@tillig
Copy link
Member

tillig commented Sep 18, 2016

Cross posted to Stack Overflow. Please try to not cross post - we monitor both places. Answers we put the community provide will be there so I'll close this issue.

Also, it'd be good to put the code snippets from here into your question there so everyone had all the info in one place.

@tillig tillig closed this as completed Sep 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants