Пример #1
0
        public string ValidateMatchingAuthors(IEnumerable <Author> authors, ICollection <AuthorDto> authorDtos)
        {
            if (authors.Count() != authorDtos.Count())
            {
                var ids   = string.Join(", ", authorDtos.Select(a => a.Id));
                var names = string.Join(", ", authorDtos.Select(a => a.Name));

                return(authorDtos != null?ValidationErrorMessages.AuthorNotFound(ids, names) : string.Empty);
            }
            return(string.Empty);
        }
Пример #2
0
 public string ValidateAuthorWasFound(string name, Author author)
 {
     return((author == null) ? ValidationErrorMessages.AuthorNotFound(name) : string.Empty);
 }