public async Task <bool> UpdateProductCatalogAsync(UpdateProductCatalogCommand command, CancellationToken cancellationToken)
        {
            var entity = await _dbContext.ProductCatalogs.FindAsync(command.Id);

            if (entity == null)
            {
                throw new NotFoundException(nameof(ProductCatalog), command.Id);
            }

            entity.Code       = command.Code;
            entity.Name       = command.Name;
            entity.Photo      = command.Photo;
            entity.Price      = command.Price;
            entity.LastUpdate = DateTime.Now;

            try
            {
                var result = await _dbContext.SaveChangesAsync(cancellationToken);

                return(result > 0);
            }
            catch (DbUpdateException ex)
            {
                throw new CodeExistsException(nameof(ProductCatalog), command.Code);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public async Task<ActionResult> Put(int id, [FromBody] UpdateProductCatalogCommand command)
        {
            if (id != command.Id)
                return BadRequest("Invalid Id, Command and Request must have same Id");

            await _mediator.Send(command);
            return NoContent();
        }