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