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