Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GlobalConfiguration.Configuration.Filters
- .Add(new ApiValidationFilter(kernel.Get<IApiAuthenticationService>()));
- kernel.Bind<IDatabaseFactory>()
- .To<DatabaseFactory>()
- .InScope(q => HttpContext.Current ?? StandardScopeCallbacks.Thread(q));
- public class ApiValidationFilter : System.Web.Http.Filters.IActionFilter
- {
- private readonly IApiAuthenticationService _apiAuthenticationService;
- public ApiValidationFilter(
- IApiAuthenticationService apiAuthenticationService)
- {
- _apiAuthenticationService = apiAuthenticationService;
- }
- kernel.Bind<MyContext>().ToSelf().InRequestScope();
Add Comment
Please, Sign In to add comment