Exemple #1
0
        public async Task <IActionResult> AddDictionaryToSection(Guid sectionId, Guid dictionaryId)
        {
            if (!(await _service.IsSectionExist(sectionId)))
            {
                return(NotFound());
            }

            if (!(await _service.IsDictionaryExist(dictionaryId)))
            {
                return(NotFound());
            }

            if (_service.IsDictionaryInSection(dictionaryId, sectionId).Result)
            {
                BadRequest();
            }

            await _service.AddDictionaryToSection(dictionaryId, sectionId);

            await _service.Save();

            return(Ok());
        }