Ejemplo n.º 1
0
 public static IHostBuilder CreateHostBuilder(string[] args) =>
 Host.CreateDefaultBuilder(args)
 .UseAutoFacContainer(AssemblyPaths.From("Dependous"), logger: (o) => Console.WriteLine($"{o}"))
 .ConfigureWebHostDefaults(webBuilder =>
 {
     webBuilder.UseStartup <Startup>();
 });
Ejemplo n.º 2
0
        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); });
        }
Ejemplo n.º 3
0
        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")));
            });
        }