public async Task <IActionResult> DeleteTeacherSocialLink(int teacherSocialLinkId) { // check phoneteache is exist in table or no TeacherSocialLink teacherSocialLinkById = await _teacherSocialLinkRepository.GetTeacherSocialLinkById(teacherSocialLinkId); if (teacherSocialLinkById == null) { return(Content("not found , please Check!...")); } else { await _teacherSocialLinkRepository.DeleteTeacherSocialLink(teacherSocialLinkById); return(Ok("Deleted Successfully")); } }
public async Task <ActionResult> AddTeacherSocialLink([FromForm] TeacherSocialLink teacherSocialLink) { if (ModelState.IsValid) { if (teacherSocialLink != null) { await _teacherSocialLinkRepository.AddTeacherSocialLink(teacherSocialLink); return(Created("TeacherSocialLinkTable", teacherSocialLink)); } else { return(NotFound()); } } return(BadRequest()); }
// Delete Teacher SocialLink public async Task DeleteTeacherSocialLink(TeacherSocialLink teacherSocialLink) { _context.TeacherSocialLinks.Remove(teacherSocialLink); await _context.SaveChangesAsync(); }
// Add new Teacher SocialLink public async Task AddTeacherSocialLink(TeacherSocialLink teacherSocialLink) { await _context.TeacherSocialLinks.AddAsync(teacherSocialLink); await _context.SaveChangesAsync(); }