public IHttpActionResult GetStudentClassByEmpId(int?id) { ObjectParameter CL_TRNNO = new System.Data.Entity.Core.Objects.ObjectParameter("CL_TRNNO", typeof(double)); if (!ModelState.IsValid) { return(BadRequest("Invalid data.")); } using (var ctx = new EMSEntities()) { ctx.spFindStudentClass(id, CL_TRNNO); var res = CL_TRNNO.Value; if (res == null) { return(NotFound()); } return(Ok(res)); } }