public async Task <ActionResult> Add(AddTeamMemberRequestVM model) { try { //if (ModelState.IsValid) { await _teamManager.AddNewTeamMember(model); return(Json(new { Status = "Success", Message = "Successfully added user to team" })); } ////else //{ // var errors = ViewData.ModelState.Values.SelectMany(s => s.Errors.Select(g => g.ErrorMessage)); // return Json(new { Status = "Error", Message = "Error adding user to team", Errors= errors }); //} } catch (Exception ex) { tc.TrackException(ex); } return(Json(new { Status = "Error", Message = "Error adding user to team" })); }