public ServiceResponse <bool> UpdateCv(CvDTO cvRequest, int userId) { var serviceResponse = new ServiceResponse <bool>(); try { if (IsUsedCvUrl(cvRequest.CvUrl, userId)) { return(serviceResponse.Error("Bu Url Adresi kullanılıyor")); } var cv = _cvRepository.Get(x => x.UserId == userId); cv.PhoneNumber = cvRequest.PhoneNumber; cv.AboutDescription = cvRequest.AboutDescription; cv.BirthDay = cvRequest.BirthDay; cv.CvUrl = cvRequest.CvUrl; cv.Email = cvRequest.Email; cv.Location = cvRequest.Location; cv.Name = cvRequest.Name; cv.SurName = cvRequest.SurName; cv.Website = cvRequest.Website; cv.City = cvRequest.City; _cvRepository.Update(cv); serviceResponse.Data = true; return(serviceResponse.Success()); } catch (Exception ex) { return(serviceResponse.Error("Cv Bilgileri Güncellenemedi")); } }
public void Update(int id, CvData cv) { var mappedCV = _mapper.Map <Repositories.Pocos.Cv>(cv); mappedCV.Id = id; _cvRepository.Update(mappedCV); }