public async Task <IActionResult> AddReplyAsync(int id, string name, string text) { try { if (ModelState.GetValidationState(nameof(text)) == ModelValidationState.Valid) { AppUser user = await userManager.FindByNameAsync(User.Identity.Name); pRepo.AddReply(text, id, user); return(View()); } return(View("Error")); } catch { return(View("Error")); } }