public ReportMissingMiddleware(RequestDelegate next, IOptions <ReportOptions> options, IStringLocalizerFactory factory, IOutputFormatter formatter) { _next = next; var reportPath = options.Value.ReportPath; if (string.IsNullOrEmpty(reportPath)) { return; } _templateMatcher = new TemplateMatcher(TemplateParser.Parse($"{reportPath}/{{filename?}}"), new RouteValueDictionary()); if (formatter == null) { throw new ArgumentNullException(nameof(formatter)); } _formatter = formatter; if (factory is ReportMissingStringLocalizerFactory rmslf) { _factory = rmslf; } else { throw new InvalidOperationException($"{ nameof(ReportMissingMiddleware) } cannot be used without { nameof(ReportMissingStringLocalizerFactory) }"); } }
public MissingKeysTagHelper(IStringLocalizerFactory factory, IOptions <ReportOptions> options) { if (factory is ReportMissingStringLocalizerFactory rmslf) { _factory = rmslf; } else { throw new InvalidOperationException($"{ nameof(MissingKeysTagHelper) } cannot be used without { nameof(ReportMissingStringLocalizerFactory) }"); } _reportPath = options.Value.ReportPath; }