-
Notifications
You must be signed in to change notification settings - Fork 9
Home
Van Nguyen edited this page May 2, 2016
·
10 revisions
For now, you will need and . After add these 2 nuget packages, simply call EnableInterceptors() on type registration you want to intercept:
var builder = new ContainerBuilder();
builder.RegisterModule(new FlatwhiteCoreModule());
builder.RegisterType<UserService>()
.As<IUserService>()
.EnableInterceptors();
Or you can apply for all registrations by using FlatwhiteBuilderInterceptModule
var builder = new ContainerBuilder();
builder.RegisterModule(new FlatwhiteCoreModule());
builder.RegisterType<BlogService>()
.AsImplementedInterfaces()
.AsSelf();
// Register other types normally
...
// Then register FlatwhiteBuilderInterceptModule at the END before building the Container
builder.RegisterModule<FlatwhiteBuilderInterceptModule>();
var container = builder.Build();
More info about built-in attributes:
Flatwhite.ExceptionFilterAttribute
Flatwhite.MethodFilterAttribute
Flatwhite.OutputCacheAttribute