public async Task <int> Handle(AddProductCommand request, CancellationToken cancellationToken)
        {
            if (request is null)
            {
                throw new InvalidNullInputException(nameof(request));
            }

            var existingProduct = await _dbContext.Set <Product>().FirstOrDefaultAsync(a => a.Name == request.Name, cancellationToken);

            if (existingProduct != null)
            {
                throw new ExistingRecordException("This Product has been added");
            }

            var product = new Product
            {
                Name  = request.Name,
                Price = request.Price
            };

            await _dbContext.Set <Product>().AddAsync(product, cancellationToken);

            await _dbContext.SaveChangesAsync(cancellationToken);

            _logger.LogInformation("Product Inserted", product);

            return(product.Id);
        }
        public virtual async Task AddAsync(TEntity entity, CancellationToken cancellationToken, bool saveNow = true)
        {
            //Assert.NotNull(entity, nameof(entity));
            await Entities.AddAsync(entity, cancellationToken).ConfigureAwait(false);

            if (saveNow)
            {
                await DbContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false);
            }
        }