Exemple #1
0
        public async Task <IActionResult> CreateWaist(WaistCreationDto dto)
        {
            var newWaist = new WaistCreationDto
            {
                Description = dto.Description,
                ColourId    = dto.ColourId
            };

            await _waistRepository.Create(newWaist);

            return(Ok(dto));
        }
Exemple #2
0
        public async Task <IActionResult> DeleteWaist(WaistCreationDto dto)
        {
            try
            {
                await _waistRepository.Delete(dto);

                return(Ok());
            }
            catch (Exception e)
            {
                return(NotFound("This Waist cannot be delete"));
            }
        }
Exemple #3
0
        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"));
            }
        }