public async Task <ResponseMessageResult <string> > CreateVacancyAsync(VacancyViewModel vacancy) { var response = new ResponseMessageResult <string>(); var newVacancy = _mapper.Map <Vacancy>(vacancy); await _vacancyRepository.AddAsync(newVacancy); await _unitOfWork.SaveChangesAsync(); response.Content = vacancy.Id.ToString(); response.Message = $"Vacancy [{vacancy.Name}] Id: [{vacancy.Id}] was successfully added"; return(response); }
public async Task AddAsync(Vacancy Vacancy) { await VacancyRepository.AddAsync(Vacancy); }