public void ConfigureServices(IObjectFactoryBuilder builder) { var paperCatalog = new PaperCatalog(); paperCatalog.Fill(); Console.WriteLine("--papers--"); foreach (var key in paperCatalog.Keys) { Console.WriteLine($"{key} => /Paper/Api/1/Modules/{key.Module}/Papers/{key.Schema}"); } Console.WriteLine("----"); builder.AddSingleton <IPaperCatalog>(paperCatalog); }
public static IObjectFactoryBuilder AddPaperObjects(this IObjectFactoryBuilder builder) { var factory = builder.ObjectFactory; var pipelineCatalog = new PipelineCatalog(); var siteMapCatalog = new SiteMapCatalog(); var paperCatalog = new PaperCatalog(); builder.AddSingleton <IObjectFactory>(factory); builder.AddSingleton <IPipelineCatalog>(pipelineCatalog); builder.AddSingleton <ISiteMapCatalog>(siteMapCatalog); builder.AddSingleton <IPaperCatalog>(paperCatalog); pipelineCatalog.ImportExposedCollections(factory); siteMapCatalog.ImportExposedCollections(factory); paperCatalog.ImportExposedCollections(factory); return(builder); }