public async Task <StudyPlaceModel> AddStudyPlace(StudyPlaceModel people) { var result = _studyPlacesRepository.Add( _mapper.Map <StudyPlace>(people) ); await _unitOfWork.CommitAsync(); return(_mapper.Map <StudyPlaceModel>(result)); }
public async Task <StudyPlaceModel> UpdateStudyPlace(StudyPlaceModel people) { if (people.Id == 1) { throw new HttpException(406, "Not Acceptable"); } var result = _studyPlacesRepository.Update( _mapper.Map <StudyPlace>(people) ); await _unitOfWork.CommitAsync(); return(_mapper.Map <StudyPlaceModel>(result)); }
public async Task <StudyPlaceModel> Put([FromBody] StudyPlaceModel model) { return(await _service.UpdateStudyPlace(model)); }
public async Task <StudyPlaceModel> Post([FromBody] StudyPlaceModel model) { return(await _service.AddStudyPlace(model)); }