public async Task <IHttpActionResult> PutSell_Price(int id, Sell_Price sell_Price) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != sell_Price.Id) { return(BadRequest()); } db.Entry(sell_Price).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Sell_PriceExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetSell_Price(int id) { Sell_Price sell_Price = await db.Sell_Price.FindAsync(id); if (sell_Price == null) { return(NotFound()); } return(Ok(sell_Price)); }
public async Task <IHttpActionResult> PostSell_Price(Sell_Price sell_Price) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Sell_Price.Add(sell_Price); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = sell_Price.Id }, sell_Price)); }
public async Task <IHttpActionResult> DeleteSell_Price(int id) { Sell_Price sell_Price = await db.Sell_Price.FindAsync(id); if (sell_Price == null) { return(NotFound()); } db.Sell_Price.Remove(sell_Price); await db.SaveChangesAsync(); return(Ok(sell_Price)); }