Пример #1
0
        public void EditAuthor(AuthorDTO authorDTO)
        {
            var author = _unitOfWork.AuthorRepository.GetByID(authorDTO.Id);

            _unitOfWork.AuthorRepository.Update(author);
            author.FirstName  = authorDTO.FirstName;
            author.LastName   = authorDTO.LastName;
            author.MiddleName = authorDTO.MiddleName;
            _unitOfWork.Commit();
        }
Пример #2
0
 public bool IsExistAuthor(AuthorDTO authorDTO)
 {
     return(_unitOfWork.AuthorRepository.Get(a => a.FirstName == authorDTO.FirstName && a.LastName == authorDTO.LastName && a.MiddleName == authorDTO.MiddleName).Count() != 0);
 }
Пример #3
0
 public void AddAuthor(AuthorDTO authorDTO)
 {
     _unitOfWork.AuthorRepository.Insert(_mapper.Map <Author>(authorDTO));
     _unitOfWork.Commit();
 }