public async Task <IActionResult> CreateWaist(WaistCreationDto dto) { var newWaist = new WaistCreationDto { Description = dto.Description, ColourId = dto.ColourId }; await _waistRepository.Create(newWaist); return(Ok(dto)); }
public async Task <IActionResult> DeleteWaist(WaistCreationDto dto) { try { await _waistRepository.Delete(dto); return(Ok()); } catch (Exception e) { return(NotFound("This Waist cannot be delete")); } }
public async Task <IActionResult> UpdateWaist(WaistCreationDto dto) { try { var update = new WaistCreationDto { Description = dto.Description, ColourId = dto.ColourId }; await _waistRepository.Update(dto); return(Ok(update)); } catch (Exception e) { return(NotFound("This Waist cannot be changed")); } }