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(); }
public bool IsExistAuthor(AuthorDTO authorDTO) { return(_unitOfWork.AuthorRepository.Get(a => a.FirstName == authorDTO.FirstName && a.LastName == authorDTO.LastName && a.MiddleName == authorDTO.MiddleName).Count() != 0); }
public void AddAuthor(AuthorDTO authorDTO) { _unitOfWork.AuthorRepository.Insert(_mapper.Map <Author>(authorDTO)); _unitOfWork.Commit(); }