public IHttpActionResult GetByID(string id) { if (parentsService.ExistsID(id) == false) { return(NotFound()); } return(Ok(parentsService.GetByID(id))); }
public IHttpActionResult PutParentToStudent(string id, string parentId) { if (studentsService.ExistsID(id) == false || parentsService.ExistsID(parentId) == false) { return(NotFound()); } if (studentsService.StudentHasParent(id, parentId) == true) { return(BadRequest("Student allready has this parent in his parent list")); } return(Ok(studentsService.PutParentToStudent(id, parentId))); }