title: Is it possible to pass a Service Filter parameters?
body: <p>I know that with regular Filters you can pass parameters like so:</p>
  
  <pre><code>[Filter(param="value")]
  public ActionResult Action()
  {
      return View();
  }
  
  public class Filter : ActionFilterAttribute
  {
      public string param { get; set; }
  
      public override void OnActionExecuting(ActionExecutingContext filterContext)
      {
          // do something with your parameter...
      }       
  }
  </code></pre>
  
  <p>I have a Service Filter:</p>
  
  <pre><code>// MyCustomFilter.cs    
  namespace MyNamespace.Filters
  {
      public class MyCustomFilter : ActionFilterAttribute
      {
          public string param { get; set; }
  
          // The services I'm injecting.
          private ILogger _logger;
          private IM3ObjectRepository _repo;
  
          public MyCustomFilter(ILogger&lt;MyCustomFilter&gt; logger, IM3ObjectRepository repo)
          {
              _logger = logger;
              _repo = repo;
          }
  
          public override void OnActionExecuting(ActionExecutingContext ctx)
          {
              _logger.LogInformation("Filter is working.");
  
              // Get stuff from object repository, based on passed-in parameter.
          }
      }
  }
  
  // Startup.cs
  public void ConfigureServices(IServiceCollection services)
  {
      ...
  
      services.AddSingleton&lt;IM3ObjectRepository, M3ObjectRepository&gt;();
  
      services.AddScoped&lt;M3UISecurityFilter&gt;();
  
      ...
  }
  
  public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
  {
      loggerFactory.AddConsole(Configuration.GetSection("Logging"));
      loggerFactory.AddDebug();
  
      loggerFactory.AddSerilog();
  
      ...
  }
  
  // Example of filter being used.
  [ServiceFilter(typeof(MyCustomFilter))]
  public IActionResult Action(...)
  {
      ...
  }
  </code></pre>
  
  <p>The filter has some services injected into it. But each time I use the service I will also be sending in a parameter.</p>
  
  <p>How would I achieve passing in a parameter? I can't find anything online describing how to do it similarly to a regular Filter. Is it even possible for a Service Filter?</p>