Beispiel #1
0
        public bool IsNameUsed(string name)
        {
            var spec = new GetPoemByNameSpec(name);

            if (_poemRepository.GetBySpec(spec) != null)
            {
                return(true);
            }

            return(false);
        }
Beispiel #2
0
        public bool IsNameUsedByOtherPoem(Guid poemId, string newName)
        {
            var spec         = new GetPoemByNameSpec(newName);
            var poemWithName = _poemRepository.GetBySpec(spec);

            if (poemWithName != null && poemWithName.Id != poemId)
            {
                return(true);
            }

            return(false);
        }