public static void AddCatalog(this IPaperCatalog baseCatalog, IPaperCatalog paperCatalog) { var aggregateCatalog = baseCatalog as AggregateCatalog; if (aggregateCatalog == null) { throw new Exception($"O catálogo base {baseCatalog.GetType().FullName} não suporta o mapeamento de um subcatálogo."); } aggregateCatalog.AddCatalog(paperCatalog); }
public PaperContext(IInjector injector, object paper, IPaperCatalog catalog, string requestUri) { requestUri = SanitizeRequestUri(requestUri); var paperSpec = PaperSpec.GetSpec(paper as Type ?? paper.GetType()); var template = paperSpec.UriTemplate; var prefix = ApiPrefix ?? ""; if (!prefix.StartsWith("/")) { prefix = "/" + prefix; } while (prefix.EndsWith("/")) { prefix = prefix.Substring(0, prefix.Length - 1); } if (!template.StartsWith("/")) { template = "/" + template; } while (template.EndsWith("/")) { template = template.Substring(0, template.Length - 1); } var composedTemplate = $"{prefix}{template}"; var uriTemplate = new UriTemplate(template); uriTemplate.SetArgsFromUri(requestUri); var args = uriTemplate.CreateArgs(); this.Injector = injector; this.Paper = paper; this.PaperCatalog = catalog; this.RequestUri = requestUri; this.UriTemplate = template; this.PathArgs = args; }
public CatalogPipeline(IWebApp webApp, IPaperCatalog paperCatalog, IObjectFactory objectFactory) { this.defaultCatalog = webApp.Name; this.paperCatalog = paperCatalog; this.objectFactory = objectFactory; }
public PaperRenderer2(IObjectFactory objectFactory, IPaperCatalog paperCatalog) { this.objectFactory = objectFactory; this.paperCatalog = paperCatalog; }
public PaperPipeline(IObjectFactory objectFactory, IPaperCatalog paperCatalog) { this.objectFactory = objectFactory; this.paperCatalog = paperCatalog; }
public PaperMiddleware(RequestDelegate next, IPaperCatalog catalog) { this.next = next; this.catalog = catalog; }