public IHttpActionResult GetCategoriesForTeacher(int teacherId) { try { return(Ok(CategoryLogic.GetCategoriesForTeacher(teacherId))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public WebResult GetCategoriesForTeacher(int teacherId) { WebResult wb = new WebResult(); try { wb.value = CategoryLogic.GetCategoriesForTeacher(teacherId); wb.status = true; wb.message = "success"; return(wb); } catch (Exception ex) { wb.message = ex.Message; wb.status = false; return(wb); } }