Autofac IFilter Registration for ASP.NET MVC VNEXT

43 views
Skip to first unread message

sebastia...@gmail.com

unread,
Dec 2, 2014, 6:16:31 PM12/2/14
to aut...@googlegroups.com
Hi Everyone, today when trying to use autofac alpha i was facing the issue of registering custom IFilter's with autofac and get them on the pipeline.
So i wrote this https://gist.github.com/nukedbit/f28b2169eea49fa2efc5, is quite simple but savee a lot of time :), i had to look at aspnet source to find out how to do it :) maybe it could be useful to add it on Autofac.Integration... ?
Then you could make it work with only this.


builder.RegisterType<Filters.ExceptionFilterAttribute>().As<IFilter>();
builder
.RegisterType<AutofacGlobalFilterProvider>()
.As<IGlobalFilterProvider>()
.InstancePerLifetimeScope();

What do you think?

Sebastian

Reply all
Reply to author
Forward
0 new messages