Example #1
0
 public DictionaryService(IDictionaryRepository ibs, ILogService ils)//依赖注入
 {
     dicRep    = ibs;
     log       = ils;
     log.Title = "字典表";
     log.Type  = TableType.SYS_DICTIONARY;
 }
 public AdministratorController(IDictionaryRepository dictionaryRepository, ICacheRepository cacheRepository, IUserRepository userRepository)
     : base(userRepository)
 {
     this.dictionaryRepository = dictionaryRepository;
     this.cacheRepository = cacheRepository;
     this.dictionaryModel = new DictionaryModel();
 }
 public DictionaryEntryController(
     IDictionaryRepository dictionaryRepository,
     IDictionaryEntryRepository dictionaryEntryRepository)
 {
     DictionaryRepository      = dictionaryRepository;
     DictionaryEntryRepository = dictionaryEntryRepository;
 }
Example #4
0
 public DictionaryController(
     IDictionaryRepository dictionaryRepository,
     IDictionaryViewSettings dictionaryViewSettings)
 {
     this.dictionaryRepository   = dictionaryRepository;
     this.dictionaryViewSettings = dictionaryViewSettings;
 }
Example #5
0
        public void Can_Perform_Update_On_DictionaryRepository()
        {
            // Arrange
            IScopeProvider provider = ScopeProvider;

            using (provider.CreateScope())
            {
                IDictionaryRepository repository = CreateRepository();

                // Act
                IDictionaryItem item         = repository.Get(1);
                var             translations = item.Translations.ToList();
                translations[0].Value = "Read even more";
                item.Translations     = translations;

                repository.Save(item);

                IDictionaryItem dictionaryItem = repository.Get(1);

                // Assert
                Assert.That(dictionaryItem, Is.Not.Null);
                Assert.That(dictionaryItem.Translations.Count(), Is.EqualTo(2));
                Assert.That(dictionaryItem.Translations.FirstOrDefault().Value, Is.EqualTo("Read even more"));
            }
        }
Example #6
0
        public void Can_Perform_Update_WithNewTranslation_On_DictionaryRepository()
        {
            // Arrange
            ILocalizationService localizationService = GetRequiredService <ILocalizationService>();
            IScopeProvider       provider            = ScopeProvider;

            using (provider.CreateScope())
            {
                IDictionaryRepository repository = CreateRepository();

                var languageNo = new Language("nb-NO", "Norwegian Bokmål (Norway)");
                localizationService.Save(languageNo);

                // Act
                IDictionaryItem item         = repository.Get(1);
                var             translations = item.Translations.ToList();
                translations.Add(new DictionaryTranslation(languageNo, "Les mer"));
                item.Translations = translations;

                repository.Save(item);

                var dictionaryItem = (DictionaryItem)repository.Get(1);

                // Assert
                Assert.That(dictionaryItem, Is.Not.Null);
                Assert.That(dictionaryItem.Translations.Count(), Is.EqualTo(3));
                Assert.That(dictionaryItem.Translations.Single(t => t.LanguageId == languageNo.Id).Value, Is.EqualTo("Les mer"));
            }
        }
        public EmployeeEditViewModel()
        {
            _repository           = Container.Resolve <IBodyguardRepository>();
            _dictionaryRepository = Container.Resolve <IDictionaryRepository>();

            CategoryCollection = _dictionaryRepository.GetCategoryCollection().ToList();
        }
Example #8
0
        public void Can_Perform_Get_On_DictionaryRepository()
        {
            // Arrange
            ILocalizationService localizationService = GetRequiredService <ILocalizationService>();
            IScopeProvider       provider            = ScopeProvider;

            using (provider.CreateScope())
            {
                IDictionaryRepository repository = CreateRepository();
                var dictionaryItem = (IDictionaryItem) new DictionaryItem("Testing1235")
                {
                    Translations = new List <IDictionaryTranslation>
                    {
                        new DictionaryTranslation(localizationService.GetLanguageByIsoCode("en-US"), "Hello world")
                    }
                };

                repository.Save(dictionaryItem);

                // re-get
                dictionaryItem = repository.Get(dictionaryItem.Id);

                // Assert
                Assert.That(dictionaryItem, Is.Not.Null);
                Assert.That(dictionaryItem.ItemKey, Is.EqualTo("Testing1235"));
                Assert.That(dictionaryItem.Translations.Any(), Is.True);
                Assert.That(dictionaryItem.Translations.Any(x => x == null), Is.False);
                Assert.That(dictionaryItem.Translations.First().Value, Is.EqualTo("Hello world"));
            }
        }
Example #9
0
 public DictionaryService(
     IDictionaryRepository dictionaryRepository,
     IWordRepository wordRepository)
 {
     this.dictionaryRepository = dictionaryRepository;
     this.wordRepository       = wordRepository;
 }
Example #10
0
 public DictionaryService(IDictionaryRepository <DictionaryEntity> dicRepository,
                          Messages messages)
     : base(dicRepository)
 {
     this.dicRepository = dicRepository;
     this.messages      = messages;
 }
Example #11
0
        public void Can_Perform_Add_On_DictionaryRepository()
        {
            // Arrange
            IScopeProvider provider = ScopeProvider;

            using (provider.CreateScope())
            {
                ILanguageRepository   languageRepository = GetRequiredService <ILanguageRepository>();
                IDictionaryRepository repository         = CreateRepository();

                ILanguage language = languageRepository.Get(1);

                var read         = new DictionaryItem("Read");
                var translations = new List <IDictionaryTranslation>
                {
                    new DictionaryTranslation(language, "Read")
                };
                read.Translations = translations;

                // Act
                repository.Save(read);

                bool exists = repository.Exists(read.Id);

                // Assert
                Assert.That(read.HasIdentity, Is.True);
                Assert.That(exists, Is.True);
            }
        }
Example #12
0
        public DictionaryService(IUnitOfWork unitOfWork,
                                 IDictionaryRepository <T> dictionaryRepository)
        {
            this.unitOfWork = unitOfWork;

            this.dictionaryRepository = dictionaryRepository;
        }
 public DictionaryController(IMapper mapper, IUnitOfWork unitOfWork, ILogger <DictionaryController> logger, IDictionaryRepository dictionaryRepository)
 {
     _mapper               = mapper;
     _unitOfWork           = unitOfWork;
     _dictionaryRepository = dictionaryRepository;
     _logger               = logger;
 }
Example #14
0
 public VacancyElasticService(IVacancyElasticRepository vacancyElasticRepository,
                              IDictionaryRepository <CandidateStatus> statusRepository,
                              IVacancyRepository vacancyRepository)
 {
     this.vacancyRepository    = vacancyRepository;
     _statusRepository         = statusRepository;
     _vacancyElasticRepository = vacancyElasticRepository;
 }
 public OnlineBookStoreService(IBookRepository bookRepository, IDictionaryRepository dictionaryRepository, IOrderRepository orderRepository, ICustomerRepository customerRepository, IAdapter adapter)
 {
     this._bookRepository = bookRepository;
     this._dictionaryRepository = dictionaryRepository;
     this._orderRepository = orderRepository;
     this._customerRepository = customerRepository;
     this._adapter = adapter;
 }
Example #16
0
        public FilterViewModel()
        {
            _navigator            = Container.Resolve <INavigator>();
            _eventAggregator      = EventContainer.EventInstance.EventAggregator;
            _dictionaryRepository = Container.Resolve <IDictionaryRepository>();

            InitCollections();
        }
 public DataManager(ILanguageRepository languageRepository, IDictionaryRepository dictionaryRepository, IWordRepository wordRepository, IUserRepository userRepository, IMessageRepository messageRepository)
 {
     this.dictionaryRepository = dictionaryRepository;
     this.wordRepository       = wordRepository;
     this.userRepository       = userRepository;
     this.messageRepository    = messageRepository;
     this.languageRepository   = languageRepository;
 }
Example #18
0
 public DictionaryService(IRepositoryContext context,
                          IDictionaryRepository iDictionaryRepository,
                          IUserRepository IUserRepository)
     : base(context)
 {
     this._IDictionaryRepository = iDictionaryRepository;
     this._IUserRepository       = IUserRepository;
 }
 public LocalizationService(IScopeProvider provider, ILogger logger, IEventMessagesFactory eventMessagesFactory,
                            IDictionaryRepository dictionaryRepository, IAuditRepository auditRepository, ILanguageRepository languageRepository)
     : base(provider, logger, eventMessagesFactory)
 {
     _dictionaryRepository = dictionaryRepository;
     _auditRepository      = auditRepository;
     _languageRepository   = languageRepository;
 }
Example #20
0
 //
 // GET: /Word/
 public WordController(IAuthService authService, IWordRepository wordRepository, IAccountRepository accountRepository, ILanguageInfosRepository languageInfosRepository, IDictionaryRepository dictionaryRepository, ITranslationRepository translationRepository)
 {
     _authService = authService;
     _wordRepository = wordRepository;
     _accountRepository = accountRepository;
     _dictionaryRepository = dictionaryRepository;
     _translationRepository = translationRepository;
     _languageInfosRepository = languageInfosRepository;
 }
Example #21
0
 public PoemGenMock(IDictionaryRepository dictionaryRepository,
                    Config config,
                    Converter converter,
                    IFootRandomGenerator footRandomGenerator,
                    INodeRandomGenerator nodeRandomGenerator,
                    IWordRandomGenerator wordRandomGenerator)
     : base(dictionaryRepository, config, converter, footRandomGenerator, nodeRandomGenerator, wordRandomGenerator)
 {
 }
Example #22
0
 public Question(TwitchResponseWriter tw, TwitchApiClient api, IDictionaryRepository repo)
 {
     this.tw          = tw;
     this.api         = api;
     this.repo        = repo;
     this.regQuestion = new Regex("^@(?<user>[a-zA-Z_0-9]+?)\\s+(?<prefix>(who|which|where|when|what|why|can|do|is|does|are|how|will)?)(\\s.*)?[?]\\s$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
     this.regPretty   = new Regex("pretty|beautiful|wonderful|sexy|bae|(best lucio)|(best mercy)", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
     random           = new Random((int)DateTime.Now.Ticks);
 }
Example #23
0
 public RootAnalysisController(
     IVerseAnalysisRepository verseAnalysisRepository,
     IDictionaryEntryRepository dictionaryEntryRepository,
     IDictionaryRepository dictionaryRepository)
 {
     VerseAnalysisRepository   = verseAnalysisRepository;
     DictionaryEntryRepository = dictionaryEntryRepository;
     DictionaryRepository      = dictionaryRepository;
 }
Example #24
0
 public RateUpdater(IDictionaryRepository <City> cityRepository, IDictionaryRepository <Currency> currencyRepository,
                    IParser parser, IReader reader, IBankService bankService, IUnitOfWork unitOfWork)
 {
     _bankService        = bankService;
     _unitOfWork         = unitOfWork;
     _reader             = reader;
     _parser             = parser;
     _cityRepository     = cityRepository;
     _currencyRepository = currencyRepository;
 }
        public void Init()
        {
            this.repo = new DictionaryRepository(ConfigHelper.ConnectionString);

            //// 清空表  確保每次跑單員測試都是乾淨的
            using (var cn = new SqlConnection(ConfigHelper.ConnectionString))
            {
                string sqlStr = @"TRUNCATE TABLE Dictionary";
                cn.Execute(sqlStr);
            }
        }
Example #26
0
        /*
         * private readonly ICacheService<Product> _csp;
         * private readonly ICacheService<ProductGroup> _cspg;
         */

        public TestController(IDictionaryRepository context, IOrdersRepository ordContext /*, ICacheService<Product> csp, ICacheService<ProductGroup> cspg*/)

        {
            _dbContext       = context;
            _dbOrdersContext = ordContext;

            /*
             * _csp = csp;
             * _cspg = cspg;
             */
        }
 public DomainObjectMapper(IRequestHandler requestHandler)
 {
     this.requestHandler         = requestHandler;
     this.classRepository        = this.requestHandler.Storage.GetRepository <IClassRepository>();
     this.memberRepositor        = this.requestHandler.Storage.GetRepository <IMemberRepository>();
     this.objectRepository       = this.requestHandler.Storage.GetRepository <IObjectRepository>();
     this.propertyRepository     = this.requestHandler.Storage.GetRepository <IPropertyRepository>();
     this.dictionaryRepository   = this.requestHandler.Storage.GetRepository <IDictionaryRepository>();
     this.cultureRepository      = this.requestHandler.Storage.GetRepository <ICultureRepository>();
     this.localizationRepository = this.requestHandler.Storage.GetRepository <ILocalizationRepository>();
 }
Example #28
0
 public ObjectManipulator(IRequestHandler requestHandler)
 {
     this.requestHandler         = requestHandler;
     this.classRepository        = this.requestHandler.Storage.GetRepository <IClassRepository>();
     this.dataTypeRepository     = this.requestHandler.Storage.GetRepository <IDataTypeRepository>();
     this.memberRepository       = this.requestHandler.Storage.GetRepository <IMemberRepository>();
     this.objectRepository       = this.requestHandler.Storage.GetRepository <IObjectRepository>();
     this.propertyRepository     = this.requestHandler.Storage.GetRepository <IPropertyRepository>();
     this.dictionaryRepository   = this.requestHandler.Storage.GetRepository <IDictionaryRepository>();
     this.localizationRepository = this.requestHandler.Storage.GetRepository <ILocalizationRepository>();
 }
Example #29
0
 public DictionaryCommandHandler(IUnitOfWork unitOfWork,
                                 IServiceBus bus,
                                 IDictionaryRepository dictionaryRepository,
                                 IDictionaryValueRepository dictionaryValueRepository,
                                 IMapper mapper)
 {
     _UnitOfWork                = unitOfWork;
     _Bus                       = bus;
     _DictionaryRepository      = dictionaryRepository;
     _DictionaryValueRepository = dictionaryValueRepository;
     _Mapper                    = mapper;
 }
Example #30
0
 public InterviewService(IUnitOfWork unitOfWork,
                         ITechInterviewRepository techRepository,
                         ICandidateRepository candidateRepository,
                         IGeneralInterviewRepository generalRepository,
                         IDictionaryRepository <CandidateStatus> statusRepository)
 {
     this.unitOfWork          = unitOfWork;
     this.techRepository      = techRepository;
     this.candidateRepository = candidateRepository;
     this.generalRepository   = generalRepository;
     this.statusRepository    = statusRepository;
 }
Example #31
0
 public OwnerService(IOwnerRepository ownerRepository,
                     IDictionaryRepository <OwnerService> dictionaryRepository,
                     IAppLogger <OwnerService> logger,
                     ISecurityService securityService,
                     IOwnerConfirmationRepository ownerConfirmationRepository)
 {
     _ownerRepository      = ownerRepository;
     _dictionaryRepository = dictionaryRepository;
     _logger                      = logger;
     _securityService             = securityService;
     _ownerConfirmationRepository = ownerConfirmationRepository;
     CheckArguments();
 }
Example #32
0
 /// <summary>
 ///  用户构造函数
 /// </summary>
 /// <param name="work">DB Work</param>
 /// <param name="repository">业务实例</param>
 /// <param name="mapper">映射</param>
 /// <param name="typeHelperService">字段验证</param>
 /// <param name="propertyMappingContainer">排序验证</param>
 public DictionaryController(IUnitDbWork work,
                             IDictionaryRepository repository,
                             IMapper mapper,
                             ITypeHelperService typeHelperService,
                             IPropertyMappingContainer propertyMappingContainer
                             )
     : base(work)
 {
     this.repository               = repository;
     this.mapper                   = mapper;
     this.typeHelperService        = typeHelperService;
     this.propertyMappingContainer = propertyMappingContainer;
 }
        public CustomerNotesAdderPresenter(ICustomerNotesAdderView view, IDictionaryRepository dictionaryRepository, INotesRepository notesRepository, ICustomerRepository customerRepository, ISecurityManager securityManager)
        {
            ArgumentChecker.ThrowIfNull(view, "view");
            ArgumentChecker.ThrowIfNull(dictionaryRepository, "dictionaryRepository");
            ArgumentChecker.ThrowIfNull(notesRepository, "notesRepository");
            ArgumentChecker.ThrowIfNull(customerRepository, "customerRepository");
            ArgumentChecker.ThrowIfNull(securityManager, "securityManager");


            this.view               = view;
            this.notesRepository    = notesRepository;
            this.customerRepository = customerRepository;
            this.securityManager    = securityManager;
        }
 public EmployeeController(IEmployeesHelper employeesHelper, IDictionaryRepository dictionaryRepository, IOrderHelper orderHelper)
 {
     _employeesHelper = employeesHelper;
     _dictionaryRepository = dictionaryRepository;
     _orderHelper = orderHelper;
 }
Example #35
0
 internal DummySource(IDictionaryRepository repository) 
     : base(Substitute.For<IGenerator>(), repository, "Dummy") { }
Example #36
0
 public MvcApplication()
 {
     this.cacheRepository = new WebCacheRepository();
     this.dictionaryRepository = new DictionaryRepository(new BasketorsContext());
 }
 public DictionaryController(IDictionaryRepository dictionaryRepository, IAuthService accountRepository, ILanguageInfosRepository languageInfosRepository)
 {
     _dictionaryRepository = dictionaryRepository;
     _authService = accountRepository;
     _languageInfosRepository = languageInfosRepository;
 }
Example #38
0
 public HomeController(IAuthService authService, IDictionaryRepository dictionaryRepository)
 {
     _authService = authService;
     _dictionaryRepository = dictionaryRepository;
 }