main
1using System.Collections.Generic;
2using Autofac;
3using gorilla.infrastructure.container;
4
5namespace solidware.financials.windows.ui.bootstrappers
6{
7 public class AutofacDependencyRegistry : DependencyRegistry
8 {
9 readonly IContainer container;
10
11 public AutofacDependencyRegistry(ContainerBuilder builder)
12 {
13 builder.Register(x => this).As<DependencyRegistry>().SingleInstance();
14 container = builder.Build();
15 }
16
17 public Contract get_a<Contract>()
18 {
19 return container.Resolve<Contract>();
20 }
21
22 public IEnumerable<Contract> get_all<Contract>()
23 {
24 return container.Resolve<IEnumerable<Contract>>();
25 }
26 }
27}