public async Task <IActionResult> CreateBrand(BrandCreationDto dto) { var newBrand = new BrandCreationDto { Name = dto.Name }; await _brandRepository.Create(newBrand); return(Ok(dto)); }
public async Task <IActionResult> DeleteBrand(BrandCreationDto dto) { try { await _brandRepository.Delete(dto); return(Ok()); } catch (Exception e) { return(NotFound("This Brand cannot be delete")); } }
public async Task <IActionResult> UpdateBrand(BrandCreationDto dto) { try { var update = new BrandCreationDto { Name = dto.Name }; await _brandRepository.Update(dto); return(Ok(update)); } catch (Exception e) { return(NotFound("This Brand cannot be changed")); } }