/// <summary>
        /// Creates a product
        /// </summary>
        /// <param name="productEntity"></param>
        /// <returns></returns>
        public int CreateProduct(BusinessEntities.ProductEntity productEntity)
        {
            var product = new Product
            {
                ProductName = productEntity.ProductName
            };

            unitOfWork.ProductRepository.Insert(product);
            unitOfWork.Save();
            return(product.ProductId);
        }
        /// <summary>
        /// Updates a product
        /// </summary>
        /// <param name="productId"></param>
        /// <param name="productEntity"></param>
        /// <returns></returns>
        public bool UpdateProduct(int productId, BusinessEntities.ProductEntity productEntity)
        {
            var success = false;

            if (productEntity != null)
            {
                var product = unitOfWork.ProductRepository.GetById(productId);
                if (product != null)
                {
                    product.ProductName = productEntity.ProductName;
                    unitOfWork.ProductRepository.Update(product);
                    unitOfWork.Save();

                    success = true;
                }
            }
            return(success);
        }