public IActionResult updateLearningDayLink([FromBody] LearningDayLink learningDayLink) { if (learningDayLink != null) { db.LearningDayLinks.Update(learningDayLink); db.SaveChanges(); return(Json(Ok("LearningDayLink updated"))); } else { return(NotFound("UPDATE: LearningDayLink was not found")); } }
public IActionResult getLearningDayLink(int id) { LearningDayLink learningDayLink = db.LearningDayLinks.Find(id); if (learningDayLink != null) { return(Json(learningDayLink)); } else { return(NotFound("GET: LearningDayLink with ID = " + id + " was not found.")); } }
public IActionResult deleteLearningDayLink(int id) { try { LearningDayLink learningDayLink = db.LearningDayLinks.Find(id); db.LearningDayLinks.Remove(learningDayLink); db.SaveChanges(); return(Json(Ok("LearningDayLink deleted"))); } catch (ArgumentNullException) { return(NotFound("DELETE: LearningDayLink with ID = " + id + " was not found.")); } }