Exemplo n.º 1
0
 public TestsController(IYearsService yearsService, IWebHostEnvironment env, IConfiguration config, IPositionService positionService)
 {
     this.yearsService    = yearsService;
     this.env             = env;
     this.config          = config;
     this.positionService = positionService;
 }
 public NavBarViewComponent(IYearsService yearsService)
 {
     this.yearsService = yearsService;
 }
 public void OnActionExecuted(ActionExecutedContext context, IYearsService yearsService)
 {
     Console.WriteLine("DO before the action executes");
 }
Exemplo n.º 4
0
 public IActionResult FromServiceAttribute([FromServices] IYearsService years)
 {
     return(Json(years.GetLastYears(5)));
 }
Exemplo n.º 5
0
 public MyResultFilterAttribute(IYearsService yearsService)
 {
     this.yearsService = yearsService;
 }
Exemplo n.º 6
0
        //private readonly string header;
        //private readonly string value;

        //public AddHeaderActionFilterAttribute(string header, string value)
        //{
        //    this.header = header;
        //    this.value = value;
        //}
        //public override void OnActionExecuting(ActionExecutingContext context)
        //{
        //    context.HttpContext.Response.Headers.Add(header, value);
        //}

        public AddHeaderActionFilterAttribute(IYearsService yearsService)
        {
            this.yearsService = yearsService;
        }