public async Task <ActionResult> Add([FromBody] CartDto cartDto) { try { await _cartService.AddAsync(cartDto); } catch (Exception e) { return(BadRequest(e.Message)); } return(CreatedAtAction(nameof(Add), new { cartDto.Id }, cartDto)); }
public async Task <ActionResult> Add([FromBody] CategoryDto categoryDto) { await _categoryService.AddAsync(categoryDto); return(CreatedAtAction(nameof(Add), new { categoryDto.Id }, categoryDto)); }
public async Task <ActionResult> Add([FromBody] ProductDto productDto) { await _productService.AddAsync(productDto); return(CreatedAtAction(nameof(Add), new { productDto.Id }, productDto)); }