public async Task <IActionResult> DeleteParent(ParentModifyInputModel inputModel, string onSubmitAction) { if (onSubmitAction.IsNullOrEmpty() || onSubmitAction == "Cancel") { return(RedirectToAction(nameof(Index))); } try { await _parentsService.DeleteAsync(inputModel.Id); return(RedirectToAction(nameof(Index))); } catch (Exception e) { _logger.LogError(e, $"An exception occured during student DELETE operation for parent with id {inputModel.Id}. Ex: {e.Message}"); return(RedirectToAction("Error", "Home")); } }