public async Task <IActionResult> CreateProvince(ProvinceCreationDto dto) { var newProvince = new ProvinceCreationDto { Description = dto.Description }; await _provinceRepository.Create(newProvince); return(Ok(dto)); }
public async Task <IActionResult> DeleteProvince(ProvinceCreationDto dto) { try { await _provinceRepository.Delete(dto); return(Ok()); } catch (Exception e) { return(NotFound("This Province cannot be delete")); } }
public async Task <IActionResult> UpdateProvince(ProvinceCreationDto dto) { try { var update = new ProvinceCreationDto { Description = dto.Description }; await _provinceRepository.Update(dto); return(Ok(update)); } catch (Exception e) { return(NotFound("This Province cannot be changed.")); } }