public HttpResponseMessage GetTrendingProjects() { using (var s = new ProjectRepository()) { s.CheckForFailedProjects(); var v = s.GetTrendingProjects(); return(Request.CreateResponse(HttpStatusCode.OK, v)); } }
public HttpResponseMessage GetAllProjectsByCategory(int categoryId) { using (var s = new ProjectRepository()) { s.CheckForFailedProjects(); var v = s.GetByCategoryId((long)categoryId); return(Request.CreateResponse(HttpStatusCode.OK, v)); } }
public HttpResponseMessage GetAllProjectsByName(string searchTerm) { using (var s = new ProjectRepository()) { s.CheckForFailedProjects(); var v = s.GetByName(searchTerm); return(Request.CreateResponse(HttpStatusCode.OK, v)); } }
public HttpResponseMessage GetProjectByIdForLoggedOutUsers(int projectId) { if (projectId <= 0) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } using (var s = new ProjectRepository()) { s.CheckForFailedProjects(); var v = s.GetProjectById(projectId); if (v == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.OK, v)); } }