public IHttpActionResult PutGrade([FromBody] Grade g, [FromUri] int id, [FromUri] int id2, [FromUri] string id3) { g.sectionid = id; g.subjectid = id2; g.studentid = id3; graderepo.Edit(g); g.HyperLinks.Add(new HyperLink() { HRef = "http://localhost:44347/api/teachers/sections/" + g.sectionid + "/subjects/" + g.subjectid + "/grades/" + g.gradeid, HttpMethod = "GET", Relation = "Get Grade" }); g.HyperLinks.Add(new HyperLink() { HRef = "http://localhost:44347/api/teachers/sections/" + g.sectionid + "/subjects/" + g.subjectid + "/grades/", HttpMethod = "POST", Relation = "Create Grade" }); g.HyperLinks.Add(new HyperLink() { HRef = "http://localhost:44347/api/teachers/sections/" + g.sectionid + "/subjects/" + g.subjectid + "/grades/" + g.gradeid, HttpMethod = "PUT", Relation = "Self" }); g.HyperLinks.Add(new HyperLink() { HRef = "http://localhost:44347/api/teachers/sections/" + g.sectionid + "/subjects/" + g.subjectid + "/grades/" + g.gradeid, HttpMethod = "DELETE", Relation = "Delete Grade" }); return(Ok(g)); }
//[TeacherAuthorization] public IHttpActionResult PutGrade([FromBody] Grade g, [FromUri] int id, [FromUri] int id2, [FromUri] int id3) { g.sectionid = id; g.subjectid = id2; g.gradeid = id3; graderepo.Edit(g); return(Ok(g)); }