Ejemplo n.º 1
0
        /// <summary>
        /// Initializes the component by creating a data manager and loading data contexts from config
        /// </summary>
        public void InitializeComponent()
        {
            // create data manager
            DataManager = ComponentContainer.Resolve<IDataManager>();

            // add data contexts
            if (ConfigManager.Components.ContainsKey(this.GetType()) &&
                ConfigManager.Components[this.GetType()].DataContexts != null)
                ConfigManager.Components[this.GetType()].DataContexts.ToList().ForEach(dataContextConfig =>
                    DataManager.AddDataContext(dataContextConfig));

            ComponentContainer.RegisterInstance<IServiceComponent>(GetType().Name, this);

            RegisterTypes();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes the component by creating a data manager and loading data contexts from config
        /// </summary>
        public void InitializeComponent()
        {
            // create data manager
            DataManager = ComponentContainer.Resolve <IDataManager>();

            // add data contexts
            if (ConfigManager.Components.ContainsKey(this.GetType()) &&
                ConfigManager.Components[this.GetType()].DataContexts != null)
            {
                ConfigManager.Components[this.GetType()].DataContexts.ToList().ForEach(dataContextConfig =>
                                                                                       DataManager.AddDataContext(dataContextConfig));
            }

            ComponentContainer.RegisterInstance <IServiceComponent>(GetType().Name, this);

            RegisterTypes();
        }