Ejemplo n.º 1
0
 public SolutionsExApiController(
     ISolutionsExDatastore datastore,
     IFrameworksDatastore frameworksDatastore,
     ILinkManagerDatastore linkManagerDatastore)
 {
     _datastore            = datastore;
     _frameworksDatastore  = frameworksDatastore;
     _linkManagerDatastore = linkManagerDatastore;
 }
 public SolutionsExLogic(
     ISolutionsExDatastore datastore,
     IHttpContextAccessor context,
     ISolutionsExFilter filter) :
     base(context)
 {
     _datastore = datastore;
     _filter    = filter;
 }
 public SearchDatastore(
     IDbConnectionFactory dbConnectionFactory,
     ILogger <SearchDatastore> logger,
     ISyncPolicyFactory policy,
     IFrameworksDatastore frameworkDatastore,
     ISolutionsDatastore solutionDatastore,
     ICapabilitiesImplementedDatastore claimedCapabilityDatastore,
     ISolutionsExDatastore solutionsExDatastore) :
     base(dbConnectionFactory, logger, policy)
 {
     _frameworkDatastore         = frameworkDatastore;
     _solutionDatastore          = solutionDatastore;
     _claimedCapabilityDatastore = claimedCapabilityDatastore;
     _solutionsExDatastore       = solutionsExDatastore;
 }
 public SearchDatastore(
     ILogger <SearchDatastore> logger,
     ISyncPolicyFactory policy,
     IFrameworksDatastore frameworkDatastore,
     ISolutionsDatastore solutionDatastore,
     ICapabilitiesDatastore capabilityDatastore,
     ICapabilitiesImplementedDatastore claimedCapabilityDatastore,
     ISolutionsExDatastore solutionExDatastore)
 {
     _logger                     = logger;
     _policy                     = policy.Build(_logger);
     _frameworkDatastore         = frameworkDatastore;
     _solutionDatastore          = solutionDatastore;
     _capabilityDatastore        = capabilityDatastore;
     _claimedCapabilityDatastore = claimedCapabilityDatastore;
     _solutionExDatastore        = solutionExDatastore;
 }
        public SolutionsExValidator(
            IHttpContextAccessor context,
            ILogger <SolutionsExValidator> logger,
            ISolutionsExDatastore datastore,
            ISolutionsValidator solutionsValidator) :
            base(context, logger)
        {
            _datastore          = datastore;
            _solutionsValidator = solutionsValidator;

            RuleSet(nameof(ISolutionsExLogic.Update), () =>
            {
                // use Solution validator
                MustBeValidSolution();

                // internal consistency checks
                ClaimedCapabilityMustBelongToSolution();
                ClaimedCapabilityEvidenceMustBelongToClaim();
                ClaimedCapabilityReviewMustBelongToEvidence();

                ClaimedStandardMustBelongToSolution();
                ClaimedStandardEvidenceMustBelongToClaim();
                ClaimedStandardReviewMustBelongToEvidence();

                TechnicalContactMustBelongToSolution();

                // all previous versions in solution
                ClaimedCapabilityEvidencePreviousVersionMustBelongToSolution();
                ClaimedStandardEvidencePreviousVersionMustBelongToSolution();

                ClaimedCapabilityReviewPreviousVersionMustBelongToSolution();
                ClaimedStandardReviewPreviousVersionMustBelongToSolution();


                // One Rule to rule them all,
                // One Rule to find them,
                // One Rule to bring them all,
                // and in the darkness bind them
                CheckUpdateAllowed();
            });
        }
        public SolutionsExLogic(
            ISolutionsModifier solutionsModifier,

            ICapabilitiesImplementedModifier capabilitiesImplementedModifier,
            IStandardsApplicableModifier standardsApplicableModifier,

            ICapabilitiesImplementedEvidenceModifier capabilitiesImplementedEvidenceModifier,
            IStandardsApplicableEvidenceModifier standardsApplicableEvidenceModifier,

            ICapabilitiesImplementedReviewsModifier capabilitiesImplementedReviewsModifier,
            IStandardsApplicableReviewsModifier standardsApplicableReviewsModifier,

            ISolutionsExDatastore datastore,
            IHttpContextAccessor context,
            ISolutionsExValidator validator,
            ISolutionsExFilter filter,
            IContactsDatastore contacts,
            IEvidenceBlobStoreLogic evidenceBlobStoreLogic) :
            base(context)
        {
            _solutionsModifier = solutionsModifier;

            _capabilitiesImplementedModifier = capabilitiesImplementedModifier;
            _standardsApplicableModifier     = standardsApplicableModifier;

            _capabilitiesImplementedReviewsModifier = capabilitiesImplementedReviewsModifier;
            _standardsApplicableReviewsModifier     = standardsApplicableReviewsModifier;

            _capabilitiesImplementedEvidenceModifier = capabilitiesImplementedEvidenceModifier;
            _standardsApplicableEvidenceModifier     = standardsApplicableEvidenceModifier;

            _datastore = datastore;
            _validator = validator;
            _filter    = filter;
            _contacts  = contacts;
            _evidenceBlobStoreLogic = evidenceBlobStoreLogic;
        }