public IActionResult AddExistingExternalUserToStep(AddResponsibleUserToStepDTO addExternalUserToStep) { Response.StatusCode = StatusCodes.Status202Accepted; if (string.IsNullOrEmpty(addExternalUserToStep.Step)) { Response.StatusCode = StatusCodes.Status400BadRequest; return(PartialView("~/Views/User/Partials/_AddNewUser.cshtml")); } var existingUser = addExternalUserToStep.ExistingResponsibleUser; if (TryValidateModel(existingUser)) { var result = _planRepository.AddUserToPlanStep(existingUser.Id.Value, addExternalUserToStep.PlanId, addExternalUserToStep.Step); if (result) { Response.StatusCode = StatusCodes.Status201Created; } else { ModelState.AddModelError(string.Empty, sharedResource.userAddExistingExternalUserToStepProblem); } } return(PartialView("~/Views/User/Partials/_AddExistingUser.cshtml")); }