public async Task <IActionResult> EditParent(ParentModifyInputModel inputModel) { if (!ModelState.IsValid || !inputModel.Parent.StudentIds.Any()) { return(View(inputModel)); } try { await _parentsService.EditAsync(inputModel); return(RedirectToAction(nameof(Index))); } catch (Exception e) { _logger.LogError(e, $"An exception occured during student UPDATE operation for parent with id {inputModel.Id}. Ex: {e.Message}"); return(RedirectToAction("Error", "Home")); } }