// GET: api/CollegesData public IHttpActionResult GetColleges() { var list = db.Colleges.ToList(); var wrapperClass = new CollegeApi { Colleges = list }; return(Ok(wrapperClass)); }
public async Task <IHttpActionResult> GetColleges(int id) { var list = new List <College> { await db.Colleges.FindAsync(id) }; if (list == null) { return(NotFound()); } var wrapperClass = new CollegeApi { Colleges = list }; return(Ok(wrapperClass)); }