public IHttpActionResult PutCoursepost(long id, Coursepost coursepost) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != coursepost.Id) { return(BadRequest()); } db.Entry(coursepost).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!CoursepostExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutEmployeemaster(long id, Employeemaster employeemaster) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != employeemaster.Id) { return(BadRequest()); } db.Entry(employeemaster).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!EmployeemasterExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }