public IActionResult GetQuantitiesByProductId(int productId) { var productQuantities = new List <ProductQuantityModel>(); if (productId > 0) { productQuantities = _productQuantityService.GetQuantityByProductId(productId); } bool status = productQuantities.Count > 0 ? true : false; return(new OkObjectResult(new { Status = status, Data = productQuantities })); }