예제 #1
0
        public async Task Rename(Concept concept, string newName, CancellationToken cancellationToken)
        {
            var existing = await _conceptRepository.GetByName(newName, cancellationToken);

            if (existing != null && existing.ConceptId != concept.ConceptId)
            {
                throw new DomainValidationException($"A concept named {newName} already exists.");
            }
            concept.Rename(newName);
        }