Guest User

Untitled

a guest
Jan 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. GlobalConfiguration.Configuration.Filters
  2. .Add(new ApiValidationFilter(kernel.Get<IApiAuthenticationService>()));
  3.  
  4. kernel.Bind<IDatabaseFactory>()
  5. .To<DatabaseFactory>()
  6. .InScope(q => HttpContext.Current ?? StandardScopeCallbacks.Thread(q));
  7.  
  8. public class ApiValidationFilter : System.Web.Http.Filters.IActionFilter
  9. {
  10. private readonly IApiAuthenticationService _apiAuthenticationService;
  11.  
  12. public ApiValidationFilter(
  13. IApiAuthenticationService apiAuthenticationService)
  14. {
  15. _apiAuthenticationService = apiAuthenticationService;
  16. }
  17.  
  18. kernel.Bind<MyContext>().ToSelf().InRequestScope();
Add Comment
Please, Sign In to add comment