コード例 #1
0
 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"));
     }
 }
コード例 #2
0
        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."));
            }
        }
コード例 #3
0
 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."));
     }
 }