Skip to content

Commit

Permalink
Bump Vpax version 1.6.0 (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
albertospelta authored Jul 21, 2024
1 parent 95953c0 commit 31d6762
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
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

0 comments on commit 31d6762

Please sign in to comment.