Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Vpax version 1.6.0 #800

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Bravo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@

<ItemGroup>
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="Dax.Model.Extractor" Version="1.5.1" />
<PackageReference Include="Dax.Model.Extractor" Version="1.6.0" />
<PackageReference Include="Dax.Template" Version="0.1.13" />
<PackageReference Include="Dax.Formatter" Version="1.1.1" />
<PackageReference Include="Dax.ViewModel" Version="1.5.1" />
<PackageReference Include="Dax.Vpax" Version="1.5.1" />
<PackageReference Include="Dax.ViewModel" Version="1.6.0" />
<PackageReference Include="Dax.Vpax" Version="1.6.0" />
<PackageReference Include="Dax.Vpax.Obfuscator" Version="1.0.5" />
<PackageReference Include="Hellang.Middleware.ProblemDetails" Version="6.5.1" />
<PackageReference Include="LargeXlsx" Version="1.8.0" />
Expand Down
24 changes: 15 additions & 9 deletions src/Infrastructure/Helpers/ConnectionStringHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Sqlbi.Bravo.Infrastructure.Security;
using Sqlbi.Bravo.Models;
using System;
using System.Data.OleDb;
using System.Data.Common;
using System.Net;

internal static class ConnectionStringHelper
Expand Down Expand Up @@ -34,7 +34,7 @@ public static string BuildFor(IPEndPoint endPoint)
var connectTimeout = 1;
var dataSource = endPoint.ToString();

var builder = new OleDbConnectionStringBuilder()
var builder = new DbConnectionStringBuilder()
{
{ ProviderKey, ProviderMsolapValue },
{ DataSourceKey, dataSource },
Expand All @@ -53,7 +53,7 @@ public static string BuildFor(PBIDesktopReport report)
BravoUnexpectedException.ThrowIfNull(report.ServerName);
BravoUnexpectedException.ThrowIfNull(report.DatabaseName);

var builder = new OleDbConnectionStringBuilder()
var builder = new DbConnectionStringBuilder()
{
{ ProviderKey, ProviderMsolapValue },
{ DataSourceKey, report.ServerName },
Expand Down Expand Up @@ -128,7 +128,7 @@ public static string BuildFor(PBICloudDataset dataset, string accessToken)

static string Build(string serverName, string databaseName, string accessToken, string identityProvider)
{
var builder = new OleDbConnectionStringBuilder()
var builder = new DbConnectionStringBuilder()
{
{ ProviderKey, ProviderMsolapValue },
{ DataSourceKey, serverName },
Expand All @@ -144,13 +144,19 @@ static string Build(string serverName, string databaseName, string accessToken,
}
}

public static (string ServerName, string? DatabaseName) GetConnectionStringProperties(string? connectionString)
public static (string? ServerName, string? DatabaseName) GetConnectionStringProperties(string? connectionString)
{
var builder = new OleDbConnectionStringBuilder(connectionString);
var builder = new DbConnectionStringBuilder(useOdbcRules: false);
builder.ConnectionString = connectionString;

var serverName = builder.DataSource;
_ = builder.TryGetValue(InitialCatalogKey, out var initialCatalog);
var databaseName = (string?)initialCatalog;
string? serverName = null;
string? databaseName = null;

if (builder.TryGetValue(DataSourceKey, out var dataSource))
serverName = (string)dataSource;

if (builder.TryGetValue(InitialCatalogKey, out var initialCatalog))
databaseName = (string)initialCatalog;

return (serverName, databaseName);
}
Expand Down
Loading