Esempio 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");
 }
Esempio n. 4
0
 public IActionResult FromServiceAttribute([FromServices] IYearsService years)
 {
     return(Json(years.GetLastYears(5)));
 }
Esempio n. 5
0
 public MyResultFilterAttribute(IYearsService yearsService)
 {
     this.yearsService = yearsService;
 }
Esempio 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;
        }