public async Task <IActionResult> DeleteCoach(int id) { _coachRepository.Delete(id); await _coachRepository.CommitAsync(); return(Ok()); }
public ActionResult DeleteConfirmed(int id) { coachRepository.Delete(id); coachRepository.Save(); return(RedirectToAction("Index")); }
public void DeleteCoach(string coachInternalId) { var dbCoach = _coachRepo.Get(c => c.COACH_INTERNAL_ID == coachInternalId); _coachRepo.Delete(c => c.COACH_INTERNAL_ID == coachInternalId); _personRepo.Delete(p => p.PERSON_ID == dbCoach.PERSON_ID); _unitOfWork.Commit(); }
public async Task <ActionResult> Delete(int?id) { if (id == null) { return(NotFound("Getting null for coach")); } await _coachRepo.Delete(id); return(Ok(id)); }
public Coach Delete(Guid id) { var Coach = _repository.GetOne(id); _repository.Delete(Coach); if (Commit()) { return(Coach); } return(null); }
public async Task <ActionResult> Delete(int id) { var toDelete = await _repository.GetAsync(id); if (toDelete == null) { return(BadRequest($"coach with {id} wasn't found")); } _repository.Delete(toDelete); await _repository.SaveChangesAsync(); return(NoContent()); }
public bool DeleteCoach(Guid Id) { try { Coach coach = _coachRepository.FindById(Id); if (coach == null) { return(false); } _coachRepository.Delete(coach); _coachRepository.Save(); return(true); } catch (Exception ex) { _logger.LogWarning($"{ex.Message}\r\n{ex.StackTrace}"); return(false); } }
public IActionResult Delete(int id) { _CoachRepo.Delete(id); return(RedirectToAction("Index")); }
public async Task DeleteAndSave(long id) { _coachRepo.Delete(id); await _coachRepo.Save(); }
public async Task Delete(int id) { _Coachs.Delete(id); await _Coachs.Save(); }