main
 1using System;
 2using System.Collections.Generic;
 3using Autofac;
 4
 5namespace common
 6{
 7    public class AutofacDependencyRegistry : DependencyRegistry
 8    {
 9        readonly Func<IContainer> container;
10
11        public AutofacDependencyRegistry(Func<IContainer> container)
12        {
13            this.container = container;
14        }
15
16        public Interface get_a<Interface>()
17        {
18            return container().Resolve<Interface>();
19        }
20
21        public IEnumerable<Interface> get_all<Interface>()
22        {
23            return container().Resolve<IEnumerable<Interface>>();
24        }
25    }
26}