public void ConfigureDependencies(IDependencyConfiguration config) { IoC.ConfigureFromResolverInterfaces(Assembly.GetExecutingAssembly()); IoC.Modules.Add<Application.ApplicationDependencyModule>(); IoC.Modules.Add<Data.DataDependencyModule>(); IoC.Modules.Add<Domain.DomainDependencyModule>(); IoC.Modules.Add<Presentation.PresentationDependencyModule>(); IoC.Modules.Add<Reports.ReportsDependencyModule>(); }
private static IDependencyConfiguration InitializeContainer(ExtensionConfigContext context) { var configType = context.Config.TypeLocator.GetTypes() .Where(x => typeof(IDependencyConfiguration).IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract) .FirstOrDefault(); IDependencyConfiguration configuration = null; if (configType != null) { var configInstance = Activator.CreateInstance(configType); configuration = (IDependencyConfiguration)configInstance; } return(configuration); }
private static IDependencyConfiguration InitializeContainer(ExtensionConfigContext context) { var configType = AppDomain.CurrentDomain.GetAssemblies() .SelectMany(x => x.GetTypes()) .FirstOrDefault(x => typeof(IDependencyConfiguration).IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract); IDependencyConfiguration configuration = null; if (configType == null) { return(configuration); } var configInstance = Activator.CreateInstance(configType); configuration = (IDependencyConfiguration)configInstance; return(configuration); }
public void ConfigureDependencies(IDependencyConfiguration config) { IoC.ConfigureFromResolverInterfaces(Assembly.GetExecutingAssembly()); }
/// <summary> /// 依赖组件初始化类构造函数,调用方需继承并实现<see cref="IDependencyConfiguration"/> /// 接口作为构造参数 /// </summary> /// <param name="dependencyConfiguration"></param> public DependencyComponentInitialization(IDependencyConfiguration dependencyConfiguration) { _dependencyConfiguration = dependencyConfiguration; _dependencyConfiguration.DependencyBindContext = new DependencyBindContext(); }
public DI(IDependencyConfiguration configuration) { this.Configuration = configuration; }