public IHttpActionResult PutSpecials(int id, Specials specials) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != specials.ID) { return BadRequest(); } db.Entry(specials).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!SpecialsExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostSpecials(Specials specials) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.Specials.Add(specials); db.SaveChanges(); return CreatedAtRoute("DefaultApi", new { id = specials.ID }, specials); }