public IActionResult AddStockPrice(StockPriceDto Obj) { if (ModelState.IsValid == false) { return(BadRequest(ModelState)); } var result = stockPriceService.AddStockPrice(Obj); if (!result) { return(BadRequest("Error saving products")); } //return CreatedAtRoute("GetProductById", new { id = obj.ID }); return(StatusCode(201)); }
public IActionResult AddStockPrice(StockPrice value) { stockService.AddStockPrice(value); return(Ok("Record Added Successfully")); }