public IHttpActionResult PutTaskAssignmentHistory(int id, TaskAssignmentHistory taskAssignmentHistory) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != taskAssignmentHistory.TaskAssignmentHistoryId) { return(BadRequest()); } db.Entry(taskAssignmentHistory).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TaskAssignmentHistoryExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetTaskAssignmentHistory(int id) { TaskAssignmentHistory taskAssignmentHistory = db.TaskAssignmentHistories.Find(id); if (taskAssignmentHistory == null) { return(NotFound()); } return(Ok(taskAssignmentHistory)); }
public IHttpActionResult PostTaskAssignmentHistory(TaskAssignmentHistory taskAssignmentHistory) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.TaskAssignmentHistories.Add(taskAssignmentHistory); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = taskAssignmentHistory.TaskAssignmentHistoryId }, taskAssignmentHistory)); }
public IHttpActionResult DeleteTaskAssignmentHistory(int id) { TaskAssignmentHistory taskAssignmentHistory = db.TaskAssignmentHistories.Find(id); if (taskAssignmentHistory == null) { return(NotFound()); } db.TaskAssignmentHistories.Remove(taskAssignmentHistory); db.SaveChanges(); return(Ok(taskAssignmentHistory)); }