示例#1
0
        internal ExpertService(
            [NotNull] IExpertRepository expertRepository,
            [NotNull] ITypeRepository <NotionType> notionTypeRepository,
            [NotNull] IRelationTypeRepository relationTypeRepository,
            [NotNull] IAssociationRepository associationRepository,
            [NotNull] IRelationRepository relationRepository)
        {
            if (expertRepository == null)
            {
                throw new ArgumentNullException(nameof(expertRepository));
            }
            if (notionTypeRepository == null)
            {
                throw new ArgumentNullException(nameof(notionTypeRepository));
            }
            if (relationTypeRepository == null)
            {
                throw new ArgumentNullException(nameof(relationTypeRepository));
            }
            if (associationRepository == null)
            {
                throw new ArgumentNullException(nameof(associationRepository));
            }
            if (relationRepository == null)
            {
                throw new ArgumentNullException(nameof(relationRepository));
            }

            _expertRepository       = expertRepository;
            _notionTypeRepository   = notionTypeRepository;
            _relationTypeRepository = relationTypeRepository;
            _associationRepository  = associationRepository;
            _relationRepository     = relationRepository;
        }
示例#2
0
 public MainWindow(IAssociationRepository repo)
 {
     _associationRepo     = repo;
     _headquarterList     = new List <string>();
     _representativesList = new List <string>();
     _legalFormList       = new List <string>();
     _associationData     = new List <KRSItemModel>();
     InitializeComponent();
 }
示例#3
0
 public CreateContactCommandHandler(ILoggerFactory loggerFactory, IUnitOfWork unitOfWork, CreateContactCommandValidator validator, IContactRepository contactRepository, IClubRepository clubRepository, ITeamRepository teamRepository, IAssociationRepository associationRepository)
 {
     this._logger                = loggerFactory.CreateLogger <CreateContactCommandHandler>();
     this._unitOfWork            = unitOfWork;
     this._validator             = validator;
     this._contactRepository     = contactRepository;
     this._clubRepository        = clubRepository;
     this._teamRepository        = teamRepository;
     this._associationRepository = associationRepository;
 }
示例#4
0
 public UpdateOnlineRegistrationConfigurationCommandHandler(ILoggerFactory loggerFactory, IUnitOfWork unitOfWork, ICompetitionRepository competitionRepository, ICompetitionRegistrationConfigurationRepository configurationRepository,
                                                            IContactRepository contactRepository, IAssociationRepository associationRepository, IClubRepository clubRepository)
 {
     this._logger                  = loggerFactory.CreateLogger <UpdateOnlineRegistrationConfigurationCommandHandler>();
     this._unitOfWork              = unitOfWork;
     this._competitionRepository   = competitionRepository;
     this._configurationRepository = configurationRepository;
     this._contactRepository       = contactRepository;
     this._associationRepository   = associationRepository;
     this._clubRepository          = clubRepository;
     this._validationResult        = new ValidationResult();
 }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GlobalDatasetLookup"/> class.
        /// </summary>
        /// <param name="domainTransactions">The domain transactions.</param>
        /// <param name="datasetRepository">The dataset repository</param>
        /// <param name="associationRepository">The association repository</param>
        /// <param name="currentModelContext">The _current model context.</param>
        public GlobalDatasetLookup([NotNull] IDomainTransactionManager domainTransactions,
                                   [NotNull] IDatasetRepository datasetRepository,
                                   [NotNull] IAssociationRepository associationRepository,
                                   [CanBeNull] ICurrentModelContext currentModelContext)
        {
            Assert.ArgumentNotNull(domainTransactions, nameof(domainTransactions));
            Assert.ArgumentNotNull(datasetRepository, nameof(datasetRepository));
            Assert.ArgumentNotNull(associationRepository, nameof(associationRepository));

            _domainTransactions    = domainTransactions;
            _datasetRepository     = datasetRepository;
            _associationRepository = associationRepository;
            _currentModelContext   = currentModelContext;
        }
示例#6
0
        public async Task <IActionResult> AddTeacherToCourse([FromServices] IAssociationRepository repository,
                                                             [FromBody] TeacherCourseAssociation association)
        {
            try
            {
                var result = await repository.AddTeacherToCourse(association);

                return(Ok(result));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
示例#7
0
        public async Task <IActionResult> RemoveStudentFromCourse([FromServices] IAssociationRepository repository,
                                                                  [FromBody] StudentCourseAssociation association)
        {
            try
            {
                await repository.RemoveStudentFromCourse(association);

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
示例#8
0
 public CatalogImporter(ILogger logger,
                        ReferenceConverter referenceConverter,
                        IContentRepository contentRepository,
                        Configuration config,
                        IRelationRepository relationRepository,
                        ICatalogService catalogService,
                        IAssociationRepository associationRepository)
 {
     _logger                = logger;
     _referenceConverter    = referenceConverter;
     _contentRepository     = contentRepository;
     _config                = config;
     _relationRepository    = relationRepository;
     _catalogService        = catalogService;
     _associationRepository = associationRepository;
 }
示例#9
0
 public ProductExportService(
     IAssociationRepository associationRepository,
     GroupDefinitionRepository <AssociationGroupDefinition> associationGroupRepository,
     ReferenceConverter referenceConverter,
     IContentLoader contentLoader,
     ProductFactory productFactory,
     IPublishedStateAssessor publishedStateAssessor)
 {
     _associationRepository      = associationRepository;
     _associationGroupRepository = associationGroupRepository;
     _referenceConverter         = referenceConverter;
     _configuration          = KachingConfiguration.Instance;
     _contentLoader          = contentLoader;
     _productFactory         = productFactory;
     _publishedStateAssessor = publishedStateAssessor;
 }
示例#10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PredictionEngineService" /> class.
 /// </summary>
 /// <param name="associationRepository">The association repository.</param>
 /// <param name="recommendationRepository">The recommendation repository.</param>
 /// <param name="referenceConverter">The reference converter.</param>
 /// <param name="orderRepository">The order repository.</param>
 /// <param name="currentMarket">The current market.</param>
 /// <param name="filterPublished">The filter published.</param>
 /// <param name="contentLoader">The content loader.</param>
 /// <param name="languageResolver">The language resolver.</param>
 /// <param name="synchronizedObjectInstanceCache">The synchronized object instance cache.</param>
 public PredictionEngineService(
     IAssociationRepository associationRepository,
     IRecommendationRepository recommendationRepository,
     ReferenceConverter referenceConverter,
     IOrderRepository orderRepository,
     ICurrentMarket currentMarket,
     FilterPublished filterPublished,
     IContentLoader contentLoader,
     LanguageResolver languageResolver,
     ISynchronizedObjectInstanceCache synchronizedObjectInstanceCache)
 {
     this.associationRepository           = associationRepository;
     this.recommendationRepository        = recommendationRepository;
     this.referenceConverter              = referenceConverter;
     this.orderRepository                 = orderRepository;
     this.currentMarket                   = currentMarket;
     this.filterPublished                 = filterPublished;
     this.contentLoader                   = contentLoader;
     this.languageResolver                = languageResolver;
     this.synchronizedObjectInstanceCache = synchronizedObjectInstanceCache;
 }
示例#11
0
        // ToDo: clean up here ... have an Aggergation for this part ... could use as demo
        private IEnumerable <ContentReference> GetAssociatedEntries(EntryContentBase currentContent)
        {
            // using linksRep is gone
            IAssociationRepository _linksRep = ServiceLocator.Current.GetInstance <IAssociationRepository>();

            IEnumerable <EPiServer.Commerce.Catalog.Linking.Association> linksRepAssoc =
                _linksRep.GetAssociations(currentContent.ContentLink).Where(l => l.Group.Name == "CrossSell");
            // would like to be able to filter when calling, instead of .Where()

            // would like to get the metadata out ... like type and group... and probaly treat them differently
            IEnumerable <EPiServer.Commerce.Catalog.Linking.Association> assoc = currentContent.GetAssociations();

            List <ContentReference> refs = new List <ContentReference>();

            foreach (EPiServer.Commerce.Catalog.Linking.Association item in assoc)
            {
                refs.Add(item.Target);
            }

            return(refs);
        }
示例#12
0
        public async Task <IActionResult> GetStudents([FromServices] IAssociationRepository repository,
                                                      [FromQuery] int page = 0, [FromQuery] int pageSize = 10)
        {
            if (page == 0 && pageSize == 0)
            {
                var result = await repository.GetAllAttends();

                if (result?.Count == 0)
                {
                    return(BadRequest("No students were associated"));
                }

                return(Ok(result));
            }

            var pagedResult = await repository.GetAttendsPaged(page, pageSize);

            if (pagedResult.TotalItems == 0)
            {
                return(BadRequest("No students were associated"));
            }

            return(Ok(pagedResult));
        }