コード例 #1
0
        public HomeController(IAppUserContext appUserContext,
                              ICacheManager cacheManager,
                              IContextManager contextManager,
                              IUserManager userManager,
                              IParameterService parameterService)
        {
            if (parameterService == null)
            {
                throw new ArgumentNullException();
            }

            if (appUserContext == null)
            {
                throw new ArgumentNullException(nameof(appUserContext));
            }

            if (cacheManager == null)
            {
                throw new ArgumentNullException(nameof(cacheManager));
            }

            if (contextManager == null)
            {
                throw new ArgumentNullException(nameof(contextManager));
            }
            if (userManager == null)
            {
                throw new ArgumentNullException(nameof(userManager));
            }
            _appUserContext   = appUserContext;
            _cacheManager     = cacheManager;
            _contextManager   = contextManager;
            _userManager      = userManager;
            _parameterService = parameterService;
        }
コード例 #2
0
        public CustomerController(ICustomerService customerService,
                                  IContributorService contributorService,
                                  IContextManager contextManager,
                                  IAppUserContext appUserContext)
        {
            if (customerService == null)
            {
                throw new ArgumentNullException(nameof(customerService));
            }

            if (contributorService == null)
            {
                throw new ArgumentNullException(nameof(contributorService));
            }

            if (contextManager == null)
            {
                throw new ArgumentNullException(nameof(contextManager));
            }

            if (appUserContext == null)
            {
                throw new ArgumentNullException(nameof(appUserContext));
            }

            _customerService    = customerService;
            _contributorService = contributorService;
            _contextManager     = contextManager;
            _appUserContext     = appUserContext;
        }
コード例 #3
0
        public ServiceDeskController(IServiceDeskService serviceDeskService,
                                     IInputTypeRefDataService inputTypeRefDataService,
                                     ITemplateService templateService,
                                     IContextManager contextManager,
                                     IAppUserContext appUserContext)
        {
            if (serviceDeskService == null)
            {
                throw new ArgumentNullException(nameof(serviceDeskService));
            }
            if (inputTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(inputTypeRefDataService));
            }
            if (templateService == null)
            {
                throw new ArgumentNullException(nameof(templateService));
            }
            if (contextManager == null)
            {
                throw new ArgumentNullException(nameof(contextManager));
            }
            if (appUserContext == null)
            {
                throw new ArgumentNullException(nameof(appUserContext));
            }

            _serviceDeskService      = serviceDeskService;
            _inputTypeRefDataService = inputTypeRefDataService;
            _templateService         = templateService;
            _contextManager          = contextManager;
            _appUserContext          = appUserContext;
        }
コード例 #4
0
        public OperationalProcessesController(IOperationalProcessTypeRefDataService operationalProcessTypeRefDataService,
                                              IResolverService resolverService,
                                              IContextManager contextManager,
                                              IAppUserContext appUserContext) : base(contextManager)
        {
            if (operationalProcessTypeRefDataService == null)
            {
                throw new ArgumentNullException("operationalProcessTypeRefDataService");
            }

            if (resolverService == null)
            {
                throw new ArgumentNullException("resolverService");
            }

            if (contextManager == null)
            {
                throw new ArgumentNullException("contextManager");
            }

            if (appUserContext == null)
            {
                throw new ArgumentNullException("appUserContext");
            }

            _operationalProcessTypeRefDataService = operationalProcessTypeRefDataService;
            _resolverService = resolverService;
            _contextManager  = contextManager;
            _appUserContext  = appUserContext;
        }
コード例 #5
0
ファイル: MenuController.cs プロジェクト: MattyJ/SLM-Solution
        public MenuController(IContextManager contextManager,
                              IAppUserContext appUserContext,
                              ICacheManager cacheManager,
                              ApplicationUserManager userManager)
        {
            if (contextManager == null)
            {
                throw new ArgumentNullException(nameof(contextManager));
            }

            if (appUserContext == null)
            {
                throw new ArgumentNullException(nameof(appUserContext));
            }

            if (cacheManager == null)
            {
                throw new ArgumentNullException(nameof(cacheManager));
            }

            if (userManager == null)
            {
                throw new ArgumentNullException(nameof(userManager));
            }

            _contextManager = contextManager;
            _appUserContext = appUserContext;
            _cacheManager   = cacheManager;
            _userManager    = userManager;
        }
コード例 #6
0
        public void AppUserContext_Constructor_SessionManagerDoesNotHoldAppContext_NewAppContextCreated()
        {
            _mockSessionManager.Setup(s => s.Get <AppContext>(SessionNames.AppContext)).Returns(null as AppContext);
            _target = new AppUserContext(_mockContextManager.Object);
            var result = _target.Current;

            Assert.IsNotNull(result);
        }
コード例 #7
0
        public ServiceDecompositionController(ICustomerService customerService,
                                              ICustomerPackService customerPackService,
                                              IDiagramService diagramService,
                                              IContributorService contributorService,
                                              ApplicationUserManager userManager,
                                              ApplicationRoleManager roleManager,
                                              IContextManager contextManager,
                                              IAppUserContext appUserContext) : base(contextManager)
        {
            if (customerService == null)
            {
                throw new ArgumentNullException(nameof(customerService));
            }

            if (contextManager == null)
            {
                throw new ArgumentNullException(nameof(contextManager));
            }

            if (appUserContext == null)
            {
                throw new ArgumentNullException(nameof(appUserContext));
            }

            if (customerPackService == null)
            {
                throw new ArgumentNullException(nameof(customerPackService));
            }

            if (diagramService == null)
            {
                throw new ArgumentNullException(nameof(diagramService));
            }

            if (contributorService == null)
            {
                throw new ArgumentNullException(nameof(contributorService));
            }

            if (userManager == null)
            {
                throw new ArgumentNullException(nameof(userManager));
            }

            if (roleManager == null)
            {
                throw new ArgumentNullException(nameof(roleManager));
            }

            _customerService     = customerService;
            _customerPackService = customerPackService;
            _diagramService      = diagramService;
            _contributorService  = contributorService;
            _userManager         = userManager;
            _roleManager         = roleManager;
            _contextManager      = contextManager;
            _appUserContext      = appUserContext;
        }
コード例 #8
0
        public ServiceDomainController(IServiceDomainService serviceDomainService,
                                       IServiceDeskService serviceDeskService,
                                       IDomainTypeRefDataService domainTypeRefDataService,
                                       IParameterService parameterService,
                                       ITemplateService templateService,
                                       IContextManager contextManager,
                                       IAppUserContext appUserContext)
        {
            if (serviceDomainService == null)
            {
                throw new ArgumentNullException(nameof(serviceDomainService));
            }

            if (serviceDeskService == null)
            {
                throw new ArgumentNullException(nameof(serviceDeskService));
            }

            if (domainTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(domainTypeRefDataService));
            }

            if (parameterService == null)
            {
                throw new ArgumentNullException(nameof(parameterService));
            }

            if (templateService == null)
            {
                throw new ArgumentNullException(nameof(templateService));
            }

            if (contextManager == null)
            {
                throw new ArgumentNullException(nameof(contextManager));
            }

            if (appUserContext == null)
            {
                throw new ArgumentNullException(nameof(appUserContext));
            }

            _serviceDomainService     = serviceDomainService;
            _serviceDeskService       = serviceDeskService;
            _domainTypeRefDataService = domainTypeRefDataService;
            _parameterService         = parameterService;
            _templateService          = templateService;
            _contextManager           = contextManager;
            _appUserContext           = appUserContext;
        }
コード例 #9
0
        public void TestInitialize()
        {
            _appContext         = new AppContext();
            _mockContextManager = new Mock <IContextManager>();

            _mockSessionManager = new Mock <ISessionManager>();
            _mockSessionManager
            .Setup(s => s.Get <AppContext>(SessionNames.AppContext))
            .Returns(_appContext);

            _mockContextManager.Setup(s => s.SessionManager).Returns(_mockSessionManager.Object);

            _target = new AppUserContext(_mockContextManager.Object);
        }
コード例 #10
0
        public TemplateController(ITemplateService templateService,
                                  IServiceDeskService serviceDeskService,
                                  IServiceDecompositionTemplateDataImportProcessor serviceDecompositionTemplateDataImportProcessor,
                                  IServiceDecompositionDesignDataImportProcessor serviceDecompositionDesignDataImportProcessor,
                                  ITemplateProcessor templateProcessor,
                                  IContextManager contextManager,
                                  IAppUserContext appUserContext)
        {
            if (templateService == null)
            {
                throw new ArgumentNullException(nameof(templateService));
            }
            if (serviceDeskService == null)
            {
                throw new ArgumentNullException(nameof(serviceDeskService));
            }
            if (serviceDecompositionTemplateDataImportProcessor == null)
            {
                throw new ArgumentNullException(nameof(serviceDecompositionTemplateDataImportProcessor));
            }
            if (serviceDecompositionDesignDataImportProcessor == null)
            {
                throw new ArgumentNullException(nameof(serviceDecompositionDesignDataImportProcessor));
            }
            if (templateProcessor == null)
            {
                throw new ArgumentNullException(nameof(templateProcessor));
            }
            if (contextManager == null)
            {
                throw new ArgumentNullException(nameof(contextManager));
            }
            if (appUserContext == null)
            {
                throw new ArgumentNullException(nameof(appUserContext));
            }

            _templateService    = templateService;
            _serviceDeskService = serviceDeskService;
            _serviceDecompositionTemplateDataImportProcessor = serviceDecompositionTemplateDataImportProcessor;
            _serviceDecompositionDesignDataImportProcessor   = serviceDecompositionDesignDataImportProcessor;
            _templateProcessor = templateProcessor;
            _contextManager    = contextManager;
            _appUserContext    = appUserContext;
        }
コード例 #11
0
        public ServiceFunctionController(IServiceDomainService serviceDomainService,
                                         IServiceFunctionService serviceFunctionService,
                                         IFunctionTypeRefDataService functionTypeRefDataService,
                                         IParameterService parameterService,
                                         IContextManager contextManager,
                                         IAppUserContext appUserContext)
        {
            if (serviceDomainService == null)
            {
                throw new ArgumentNullException(nameof(serviceDomainService));
            }

            if (serviceFunctionService == null)
            {
                throw new ArgumentNullException(nameof(serviceFunctionService));
            }

            if (functionTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(functionTypeRefDataService));
            }

            if (parameterService == null)
            {
                throw new ArgumentNullException(nameof(parameterService));
            }

            if (contextManager == null)
            {
                throw new ArgumentNullException(nameof(contextManager));
            }

            if (appUserContext == null)
            {
                throw new ArgumentNullException(nameof(appUserContext));
            }

            _serviceDomainService       = serviceDomainService;
            _serviceFunctionService     = serviceFunctionService;
            _functionTypeRefDataService = functionTypeRefDataService;
            _parameterService           = parameterService;
            _contextManager             = contextManager;
            _appUserContext             = appUserContext;
        }
コード例 #12
0
        public DiagramController(IDiagramService diagramService,
                                 IServiceDeskService serviceDeskService,
                                 IAppUserContext appUserContext,
                                 IContextManager contextManager,
                                 IUserIdentity userIdentity,
                                 IObjectBuilder objectBuilder)
        {
            if (diagramService == null)
            {
                throw new ArgumentNullException(nameof(diagramService));
            }

            if (serviceDeskService == null)
            {
                throw new ArgumentNullException(nameof(serviceDeskService));
            }

            if (appUserContext == null)
            {
                throw new ArgumentNullException(nameof(appUserContext));
            }

            if (contextManager == null)
            {
                throw new ArgumentNullException(nameof(contextManager));
            }
            if (userIdentity == null)
            {
                throw new ArgumentNullException(nameof(userIdentity));
            }

            if (objectBuilder == null)
            {
                throw new ArgumentNullException(nameof(objectBuilder));
            }

            _diagramService     = diagramService;
            _serviceDeskService = serviceDeskService;
            _appUserContext     = appUserContext;
            _contextManager     = contextManager;
            _userIdentity       = userIdentity;
            _objectBuilder      = objectBuilder;
        }
コード例 #13
0
 protected BaseServiceComponentController(IContextManager contextManager,
                                          IServiceComponentService serviceComponentService,
                                          IServiceFunctionService serviceFunctionService,
                                          IServiceDeliveryOrganisationTypeRefDataService serviceDeliveryOrganisationTypeRefDataService,
                                          IServiceDeliveryUnitTypeRefDataService serviceDeliveryUnitTypeRefDataService,
                                          IResolverGroupTypeRefDataService resolverGroupTypeRefDataService,
                                          IParameterService parameterService,
                                          IAppUserContext appUserContext,
                                          IServiceComponentHelper serviceComponentHelper)
     : base(contextManager)
 {
     _contextManager          = contextManager;
     _serviceComponentService = serviceComponentService;
     _serviceFunctionService  = serviceFunctionService;
     _serviceDeliveryOrganisationTypeRefDataService = serviceDeliveryOrganisationTypeRefDataService;
     _serviceDeliveryUnitTypeRefDataService         = serviceDeliveryUnitTypeRefDataService;
     _resolverGroupTypeRefDataService = resolverGroupTypeRefDataService;
     _parameterService       = parameterService;
     _appUserContext         = appUserContext;
     _serviceComponentHelper = serviceComponentHelper;
 }
コード例 #14
0
 public AppUserRepository(IOptions <Settings> settings)
 {
     _context = new AppUserContext(settings);
 }
コード例 #15
0
        public ServiceComponentController(IContextManager contextManager,
                                          IAppUserContext appUserContext,
                                          IServiceComponentService serviceComponentService,
                                          IServiceFunctionService serviceFunctionService,
                                          IServiceDeliveryOrganisationTypeRefDataService serviceDeliveryOrganisationTypeRefDataService,
                                          IServiceDeliveryUnitTypeRefDataService serviceDeliveryUnitTypeRefDataService,
                                          IResolverGroupTypeRefDataService resolverGroupTypeRefDataService,
                                          IParameterService parameterService,
                                          IServiceComponentHelper serviceComponentHelper) : base(contextManager,
                                                                                                 serviceComponentService,
                                                                                                 serviceFunctionService,
                                                                                                 serviceDeliveryOrganisationTypeRefDataService,
                                                                                                 serviceDeliveryUnitTypeRefDataService,
                                                                                                 resolverGroupTypeRefDataService,
                                                                                                 parameterService,
                                                                                                 appUserContext,
                                                                                                 serviceComponentHelper)
        {
            if (contextManager == null)
            {
                throw new ArgumentNullException(nameof(contextManager));
            }

            if (appUserContext == null)
            {
                throw new ArgumentNullException(nameof(appUserContext));
            }

            if (serviceComponentService == null)
            {
                throw new ArgumentNullException(nameof(serviceComponentService));
            }

            if (serviceFunctionService == null)
            {
                throw new ArgumentNullException(nameof(serviceFunctionService));
            }

            if (serviceDeliveryOrganisationTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(serviceDeliveryOrganisationTypeRefDataService));
            }

            if (serviceDeliveryUnitTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(serviceDeliveryUnitTypeRefDataService));
            }

            if (resolverGroupTypeRefDataService == null)
            {
                throw new ArgumentNullException(nameof(resolverGroupTypeRefDataService));
            }

            if (parameterService == null)
            {
                throw new ArgumentNullException(nameof(parameterService));
            }

            if (serviceComponentHelper == null)
            {
                throw new ArgumentNullException(nameof(serviceComponentHelper));
            }

            _contextManager          = contextManager;
            _appUserContext          = appUserContext;
            _serviceComponentService = serviceComponentService;
            _serviceFunctionService  = serviceFunctionService;
            _serviceDeliveryOrganisationTypeRefDataService = serviceDeliveryOrganisationTypeRefDataService;
            _serviceDeliveryUnitTypeRefDataService         = serviceDeliveryUnitTypeRefDataService;
            _resolverGroupTypeRefDataService = resolverGroupTypeRefDataService;
            _parameterService       = parameterService;
            _serviceComponentHelper = serviceComponentHelper;
        }