Exemplo n.º 1
0
        public IActionResult Create([FromBody] ProductCreateDto model)
        {
            long productId = _productApplicationService.Create(model);

            _amqpApplicationService.PublishMessage(productId);
            return(Ok("Product Created!"));
        }
        public Task <HttpResponseMessage> Post([FromBody] dynamic body)
        {
            var command = new CreateProductCommand(
                title: (string)body.title,
                categoryId: (int)body.category,
                description: (string)body.description,
                price: (decimal)body.price,
                quantityOnHand: (int)body.quantityOnHand,
                image: (string)body.image
                );

            var product = _service.Create(command);

            return(CreateResponse(HttpStatusCode.Created, product));
        }
Exemplo n.º 3
0
 public IActionResult Create([FromBody] ProductCreateDto model)
 {
     _productApplicationService.Create(model);
     _logger.LogInformation("Product Create!");
     return(Ok("Product Created!"));
 }
Exemplo n.º 4
0
        public async Task <IActionResult> Create([FromBody] ProductModelRequest request)
        {
            ResultResponse result = await _productApplicationService.Create(request);

            return(Response(result));
        }