public async Task <ActionResult> ValidateCustomerTenant(ValidateTenantDto model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var intialInfo = await _adminService.GetCustomerInialInfo(model.HostName); if (intialInfo != null && !string.IsNullOrEmpty(intialInfo.TenantDBServer)) { return(Ok(new { Valid = true, Info = intialInfo })); } return(NotFound()); } catch (Exception ex) { _logger.LogError(ex.StackTrace); return(StatusCode(StatusCodes.Status500InternalServerError, "Something went wrong!")); } }
private async Task <CustomerInitialInfoModel> GetTenantDbInfo(string hostName) { var intialInfo = await _adminService.GetCustomerInialInfo(hostName); if (_testTenantInfo.UseTestTenantInfo) { intialInfo.TenantDBServer = _testTenantInfo.TenantDBServer; intialInfo.TenantDBName = _testTenantInfo.TenantDBName; intialInfo.TenantDBUser = _testTenantInfo.TenantDBUser; intialInfo.TenantDBPassword = _testTenantInfo.TenantDBPassword; } return(intialInfo); }