public IHttpActionResult Putsupportticket(int id, supportticket supportticket) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != supportticket.ID) { return(BadRequest()); } db.Entry(supportticket).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!supportticketExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Getsupportticket(int id) { supportticket supportticket = db.supporttickets.Find(id); if (supportticket == null) { return(NotFound()); } return(Ok(supportticket)); }
public IHttpActionResult Postsupportticket(supportticket supportticket) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.supporttickets.Add(supportticket); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = supportticket.ID }, supportticket)); }
public IHttpActionResult Deletesupportticket(int id) { supportticket supportticket = db.supporttickets.Find(id); if (supportticket == null) { return(NotFound()); } db.supporttickets.Remove(supportticket); db.SaveChanges(); return(Ok(supportticket)); }