public bool AddNewTermWithSynonyms(TermWithSynonymsInput termWithSynonymsInput)
        {
            return(ExecuteDbOperation(() =>
            {
                var termWithSynonyms = _synonymsMapper.Map(termWithSynonymsInput);
                using (var applicationDbContext = _applicationDbContextFactory())
                {
                    applicationDbContext.Add(termWithSynonyms);
                    applicationDbContext.SaveChanges();
                }

                return true;
            }));
        }
Пример #2
0
 public TermWithSynonyms Map(TermWithSynonymsInput termWithSynonymsInput)
 {
     return(new TermWithSynonyms(termWithSynonymsInput.Term, termWithSynonymsInput.Synonyms));
 }