public IHttpActionResult PutmemberList(int id, raceListModel.memberList memberList) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != memberList.Id) { return(BadRequest()); } db.Entry(memberList).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!memberListExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetmemberList(int id) { raceListModel.memberList memberList = db.memberLists.Find(id); if (memberList == null) { return(NotFound()); } return(Ok(memberList)); }
public IHttpActionResult PostmemberList(raceListModel.memberList memberList) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.memberLists.Add(memberList); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = memberList.Id }, memberList)); }
public IHttpActionResult DeletememberList(int id) { raceListModel.memberList memberList = db.memberLists.Find(id); if (memberList == null) { return(NotFound()); } db.memberLists.Remove(memberList); db.SaveChanges(); return(Ok(memberList)); }