public async Task <JsonResult> OnBoardProvider([FromBody] ProviderAjaxRequestModel ajaxRequest) { _logger.LogMethodEnter(); _logger.LogInformationObject("RequestModel", ajaxRequest); string ResultText = string.Empty; bool Success = true; if (string.IsNullOrEmpty(ajaxRequest.ProviderId)) { ResultText = "ProviderId was NOT passed to our system"; Success = false; } else if (ajaxRequest.ProviderId.Equals("00000000-0000-0000-0000-000000000000", StringComparison.InvariantCultureIgnoreCase)) { ResultText = "Invalid ProviderId was passed to our system"; Success = false; } else { try { // TODO - UpdatedBy will be updated with the name of logged person ProviderAdd providerAdd = new ProviderAdd(new Guid(ajaxRequest.ProviderId), (int)Status.Onboarded, "ProviderPortal - Add Provider"); var result = await _providerService.AddProviderAsync(providerAdd); if (result.IsSuccess && result.HasValue) { ResultText = "Provider added."; } else { ResultText = "Provider Add Service did NOT return a result."; Success = false; } } catch (Exception ex) { ResultText = ex.Message; Success = false; } } _logger.LogInformation("Success", Success); _logger.LogInformation("ResultText", ResultText); _logger.LogMethodExit(); return(Json(new { success = Success, resultText = ResultText })); }