public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .UseAutoFacContainer(AssemblyPaths.From("Dependous"), logger: (o) => Console.WriteLine($"{o}")) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup <Startup>(); });
public TestDecoration(ITestOutputHelper outputHelper) { output = outputHelper; var serviceCollection = new ServiceCollection(); serviceCollection.AddDependencyScanning(); container = serviceCollection.BuildAutoFacContainer(AssemblyPaths.From("SportsConnect", "Dependous"), logger: (item) => { output.WriteLine($"{item}"); Console.WriteLine(item); }); }
public AutofacContainerTests(ITestOutputHelper outputHelper) { output = outputHelper; var serviceCollection = new ServiceCollection(); serviceCollection.AddSingleton <MyObject>(); serviceCollection.AddSingleton(new TestObject()); serviceCollection.AddDependencyScanning(b => b.AddSingleton <MyObject>().AddSingleton(new TestObject())); container = serviceCollection.BuildAutoFacContainer(AssemblyPaths.From("Dependous"), logger: (item) => { output.WriteLine($"{item}"); Console.WriteLine(item); }, configurationBuilder: (cb) => { cb.PersistScanResults = true; // cb.InterceptAll<DynamicInterceptor>(); cb.AddProbingPaths(pb => pb.AddProbingPath("../../../../../tests/Dependous.Probing/bin/Debug/netstandard2.1", (p) => p.StartsWith("Dependous.Probing"))); }); }