Exemplo n.º 1
0
        public void ModifyTranslate(ModifyTranslateDTO dto)
        {
            var translator = _repository.GetById(dto.Id);
            var language   = new LanguageBuilder().WithAbbrevation(dto.LanguageAbbr).Build();
            var phraseType = new PhraseTypeBuilder().WithName(dto.PhraseType).Build();
            var phrase     = new PhraseBuilder().WithId(dto.PhraseId).WithPhraseType(phraseType).Build();

            translator.Update(phrase, language, dto.Translation);
        }
Exemplo n.º 2
0
        public void CreateTranslate(CreateTranslateDTO dto)
        {
            var phraseType = new PhraseTypeBuilder().WithName(dto.PhraseType).Build();                    //GetPhraseTypeByName(dto.PhraseType);
            var phrase     = new PhraseBuilder().WithId(dto.PhraseId).WithPhraseType(phraseType).Build(); //GetPhraseById(dto.PhraseId, phraseType);
            var language   = new LanguageBuilder().WithAbbrevation(dto.LanguageAbbr).Build();             //new Language(dto.LanguageId, dto.LanguageName);
            var translate  = new Translator(0, phrase, language, dto.Translation);

            _repository.Save(translate);
        }