public IActionResult Post([FromBody] Sale sale) { if (ModelState.IsValid) { //string uniqueNumber = String.Format("{0:d9}", (DateTime.Now.Ticks / 10) % 1000000000); bool isAdded = _SaleManager.Add(sale); if (isAdded) { return(Ok(sale)); } return(BadRequest(new { error = "Failed to Add!" })); } return(BadRequest(new { error = "Model Sate is Not Valid! " })); }