public IHttpActionResult GetAllSchools() { try { ILandingPageSchool schoolService = new LandingPageSchool(); return(Json(new Response { Message = "All school data", Data = schoolService.GetAll(), Status = true })); } catch (Exception e) { throw e; } }
public IHttpActionResult GetSchoolById(int id) { try { ILandingPageSchool schoolService = new LandingPageSchool(); return(Json(new Response { Message = "School data by id", Data = schoolService.GetSchoolById(id), Status = true })); } catch (Exception e) { throw e; } }
public IHttpActionResult PostSchool([FromBody] School school) { try { ILandingPageSchool schoolService = new LandingPageSchool(); schoolService.CreateEntry(school); return(Json(new Response { Message = "School created", Data = null, Status = true })); } catch (Exception e) { throw e; } }