public DeleteStudentPromotion DeleteStudentPromotion(DeleteStudentPromotion obj) { var returnModel = new DeleteStudentPromotion(); var StudentPromotions = _StudentPromotionsRepo.Get(obj.StudentPromotionsId); if (StudentPromotions != null) { _StudentPromotionsRepo.Delete(StudentPromotions); } return(returnModel); }
public async Task <IActionResult> DeletePromotion(long StudentPromotionsId) { try { var model = new DeleteStudentPromotion() { StudentPromotionsId = StudentPromotionsId }; await Task.Run(() => _StudentPromotionsServ.DeleteStudentPromotion(model)); } catch (Exception) { return(BadRequest()); } return(RedirectToAction("StudentPromotionsList")); }