public IHttpActionResult Update([FromBody] SubclassUpdateModel subclassToUpdate, [FromUri] int subclassId)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     _service = new SubclassService();
     _service.UpdateSubclass(subclassToUpdate, subclassId);
     return(Ok());
 }
 public IHttpActionResult Create(SubclassCreateModel subclassToCreate)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     _service = new SubclassService();
     _service.CreateSubclass(subclassToCreate);
     return(Ok());
 }
 public IHttpActionResult Delete([FromUri] int subclassId)
 {
     _service = new SubclassService();
     _service.DeleteSubclass(subclassId);
     return(Ok());
 }
 public IHttpActionResult GetList([FromUri] int classId)
 {
     _service = new SubclassService();
     return(Ok(_service.GetSubclassesByParentClass(classId)));
 }
 public IHttpActionResult GetDetail([FromUri] int subclassId)
 {
     _service = new SubclassService();
     return(Ok(_service.GetSubclassDetailById(subclassId)));
 }