예제 #1
0
        public static T GetService <T>(IDictionary <string, object> dict)
        {
            if (dict == null || dict.Count == 0)
            {
                return(AutofacManage.GetService <T>());
            }
            NamedParameter[] array = new NamedParameter[dict.Count];
            int num = 0;

            foreach (KeyValuePair <string, object> current in dict)
            {
                array[num++] = new NamedParameter(current.Key, current.Value);
            }
            IComponentContext _contain = AutofacManage.container;

            Parameter[] paramer = array;
            return(ResolutionExtensions.Resolve <T>(_contain, paramer));
        }
예제 #2
0
 public static void Init()
 {
     AutofacManage.Build();
 }