public async Task <ActionResult> DeProvisionPowerBITenants(CustomerDbCredsInputDto model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var(succeed, message) = await _provisionPowerBITenantsService.DeProvision(model.GetConnectionString()); if (succeed) { return(Ok()); } else { return(StatusCode(StatusCodes.Status500InternalServerError, message)); } } catch (Exception ex) { _logger.LogError(ex.StackTrace); return(StatusCode(StatusCodes.Status500InternalServerError, "Something went wrong!")); } }
public async Task <ActionResult> ValidateCustomerDbInfo(CustomerDbCredsInputDto model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var succeed = await _provisionPowerBITenantsService.ValidateDBInfo(model.GetConnectionString()); if (succeed) { return(Ok()); } else { return(StatusCode(StatusCodes.Status404NotFound, "Database credentials are not valid.")); } } catch (Exception ex) { _logger.LogError(ex.StackTrace); return(StatusCode(StatusCodes.Status500InternalServerError, "Something went wrong!")); } }