Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. private readonly IRepository _repository;
  2.  
  3. public MyController(repository)
  4. {
  5. _repository = repository;
  6. }
  7.  
  8. [HttpGet]
  9. [CustomFilter(_repository)]
  10. public async IHttpActionResult([FromUri]int customerid)
  11. {
  12. }
  13.  
  14. public class CustomFilter : ActionFilterAttribute
  15. {
  16. private readonly IRepository _repository;
  17.  
  18. public CustomFilter(IRepository repository)
  19. {
  20. _repository = repository;
  21. }
  22.  
  23. kernel.BindFilter<CustomFilter>(FilterScope.Action, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement