public IHttpActionResult Post(TBL_USER_PROJECT tBL_USER_PROJECT) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.TBL_USER_PROJECT.Add(tBL_USER_PROJECT); try { db.SaveChanges(); } catch (DbUpdateException) { if (Exists(tBL_USER_PROJECT.USER_ID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = tBL_USER_PROJECT.USER_ID }, tBL_USER_PROJECT)); }
public IHttpActionResult Put(int id, TBL_USER_PROJECT tBL_USER_PROJECT) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tBL_USER_PROJECT.USER_ID) { return(BadRequest()); } db.Entry(tBL_USER_PROJECT).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Exists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Get(int id) { TBL_USER_PROJECT tBL_USER_PROJECT = db.TBL_USER_PROJECT.Find(id); if (tBL_USER_PROJECT == null) { return(NotFound()); } return(Ok(tBL_USER_PROJECT)); }
public IHttpActionResult Delete(int id) { TBL_USER_PROJECT tBL_USER_PROJECT = db.TBL_USER_PROJECT.Find(id); if (tBL_USER_PROJECT == null) { return(NotFound()); } db.TBL_USER_PROJECT.Remove(tBL_USER_PROJECT); db.SaveChanges(); return(Ok(tBL_USER_PROJECT)); }