public IActionResult DeleteProduct(FarmerProductDTO farmerProduct)
        {
            var products = _productService.GetById(farmerProduct.Id);

            _productService.Delete(_mapper.Map <FarmerProduct>(products));
            return(Ok());
        }
        public IActionResult DeleteProducts(FarmerProductDTO farmerProductDTO)
        {
            var products = _productService.GetById(farmerProductDTO.Id);

            if (products == null)
            {
                throw new ArgumentNullException($"{farmerProductDTO.Id} ye sahip ürün bulunamadı");
            }

            _productService.Delete(_mapper.Map <FarmerProduct>(farmerProductDTO));
            return(Ok());
        }
 public IActionResult AddProduct(FarmerProductDTO farmerProduct)
 {
     _productService.Create(_mapper.Map <FarmerProduct>(farmerProduct));
     return(Ok());
 }