/// <summary> /// 设置新的依赖注入容器 /// </summary> /// <param name="container">依赖注入容器</param> /// <param name="configFileName">配置文件名称</param> /// <returns>依赖注入上下文</returns> public DiContext SetContainer(IDIContainer container, string configFileName = "") { if (container != null) { Container = container; if (!string.IsNullOrEmpty(configFileName)) { container.Init(_name, configFileName); } } return(this); }