title: How to inject an IStringLocalizer into IApplicationModelConvention?
body: <p>I have a custom convention that requires localized strings inside of it. AFAIK the only way to instantiate an IStringLocalizer is DependencyInjection.</p>
  
  <p>How can I use an IStringLocalizer inside of my CustomConvention?</p>
  
  <p>The convention isregistered like this</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
       //First I register the localization settings
       services.AddLocalization(o =&gt;
       {
          o.ResourcesPath = "Resources";
       });
  
        services.AddMvc(options =&gt;
        {
             //My custom convention, I would need to inject an IStringLocalizer  
             //into constructor here, but I can' instantiate it
             options.Conventions.Add(new LocalizationRouteConvention());
        })
  }
  </code></pre>