示例#1
0
        public bool AddModule(IDomainModule module)
        {
            if (module == null)
            {
                throw Error.ArgumentNull("module");
            }

            ThrowIfLocked();

            return DomainModules.Add(module);
        }
        public static void RegisterIfNotRegistered(this IDomainModuleService domainModuleService, IDomainModule domainModule)
        {
            if (domainModule == null)
            {
                throw Error.ArgumentNull("domainModule");
            }

            if (!domainModuleService.IsRegistered(domainModule))
            {
                domainModuleService.Register(domainModule);
            }
        }
        public static void RegisterIfNotRegistered(this IDomainModuleService domainModuleService, IDomainModule domainModule, string group)
        {
            if (domainModule == null)
            {
                throw Error.ArgumentNull("domainModule");
            }

            if (group.IsNullOrEmpty())
            {
                throw Error.ArgumentNullOrEmpty("group");
            }

            if (!domainModuleService.IsRegistered(domainModule))
            {
                domainModuleService.Register(domainModule, group);
            }
        }