public HttpResponseMessage addStudentDetails(studentDetails studentDetails) { ReturnData rd = new ReturnData(); rd = studentDetails.addStudentDetails(); string yourJson = JsonConvert.SerializeObject(rd);; var response = this.Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(yourJson, Encoding.UTF8, "application/json"); return(response); }
public HttpResponseMessage getStudentDetails(string user_id) { List <studentDetails> list = new List <studentDetails>(); studentDetails u = new studentDetails(); list = u.getStudentDetails(user_id); string yourJson = JsonConvert.SerializeObject(list); var response = this.Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(yourJson, Encoding.UTF8, "application/json"); return(response); }
public HttpResponseMessage getStudentDetailsinlineFormUserID(string inlineFormUserID, string inlineFormUserName, string inlineFormEmailAddress, string inlineFormPhone) { List <studentDetails> list = new List <studentDetails>(); studentDetails c = new studentDetails(); list = c.getStudentDetailsinlineFormUserID(inlineFormUserID, inlineFormUserName, inlineFormEmailAddress, inlineFormPhone); string yourJson = JsonConvert.SerializeObject(list);; var response = this.Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(yourJson, Encoding.UTF8, "application/json"); return(response); }