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

ExecuteProcedure - add managed identity authentication #50

Merged
merged 3 commits into from
Aug 8, 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
4 changes: 4 additions & 0 deletions Frends.MicrosoftSQL.ExecuteProcedure/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [2.0.0] - 2024-08-05
### Changed
- [Breaking] The task now uses Microsoft.Data.SqlClient instead of System.Data.SqlClient.

## [1.2.1] - 2024-02-12
### Fixed
- Fixed issue with null parameters by changing them into DBNull.Value.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Frends.MicrosoftSQL.ExecuteProcedure.Definitions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json.Linq;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

namespace Frends.MicrosoftSQL.ExecuteProcedure.Tests;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Frends.MicrosoftSQL.ExecuteProcedure.Definitions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

namespace Frends.MicrosoftSQL.ExecuteProcedure.Tests;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Frends.MicrosoftSQL.ExecuteProcedure.Definitions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

namespace Frends.MicrosoftSQL.ExecuteProcedure.Tests;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Frends.MicrosoftSQL.ExecuteProcedure.Definitions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

namespace Frends.MicrosoftSQL.ExecuteProcedure.Tests;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
namespace Frends.MicrosoftSQL.ExecuteProcedure.Tests;

using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

internal static class Helper
{
internal static string GetConnectionString()
{
var user = "SA";
var pwd = "Salakala123!";
return $"Server=127.0.0.1,1433;Database=Master;User Id={user};Password={pwd}";
return $"Server=127.0.0.1,1433;Database=Master;User Id={user};Password={pwd};TrustServerCertificate=True";
}

internal static string GetInvalidConnectionString()
{
var user = "SA";
var pwd = "WrongPassWord";
return $"Server=127.0.0.1,1433;Database=Master;User Id={user};Password={pwd}";
return $"Server=127.0.0.1,1433;Database=Master;User Id={user};Password={pwd};TrustServerCertificate=True";
}

// Simple select query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -42,10 +42,10 @@ public static async Task<Result> ExecuteProcedure([PropertyTab] Input input, [Pr
{
foreach (var parameter in input.Parameters)
{
if (parameter.Value is null)
if (parameter.Value is null)
parameter.Value = DBNull.Value;

if (parameter.SqlDataType is SqlDataTypes.Auto)
if (parameter.SqlDataType is SqlDataTypes.Auto)
command.Parameters.AddWithValue(parameterName: parameter.Name, value: parameter.Value);
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.2.1</Version>
<Version>2.0.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Expand All @@ -22,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
</ItemGroup>
</Project>
Loading