Updated
This commit is contained in:
parent
6340a48019
commit
c018d1073b
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
|
using EonaCat.Json.Linq;
|
||||||
using EonaCat.Sql.Extensions;
|
using EonaCat.Sql.Extensions;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
|
|
||||||
namespace EonaCat.Sql
|
namespace EonaCat.Sql
|
||||||
|
@ -22,8 +24,13 @@ namespace EonaCat.Sql
|
||||||
var customerId = 2;
|
var customerId = 2;
|
||||||
var result = SqlHelper.ExecuteQuery(
|
var result = SqlHelper.ExecuteQuery(
|
||||||
@"Server=EONACATLAPTOP\SQLEXPRESS;Database=AdventureWorks2019;User Id=sa;Password=jeroen;TrustServerCertificate=Yes;",
|
@"Server=EONACATLAPTOP\SQLEXPRESS;Database=AdventureWorks2019;User Id=sa;Password=jeroen;TrustServerCertificate=Yes;",
|
||||||
$"SELECT * FROM Person.Person WHERE BusinessEntityID = @0 AND rowguid = @1"
|
$"SELECT * FROM Person.Person WHERE BusinessEntityID = @id AND rowguid = @guid",
|
||||||
, true, customerId, "D8763459-8AA8-47CC-AFF7-C9079AF79033");
|
new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
{ "id", customerId },
|
||||||
|
{ "guid", "D8763459-8AA8-47CC-AFF7-C9079AF79033" },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
if (result.HasResult && result.HasRows)
|
if (result.HasResult && result.HasRows)
|
||||||
{
|
{
|
||||||
|
@ -31,8 +38,8 @@ namespace EonaCat.Sql
|
||||||
Console.WriteLine(string.Empty);
|
Console.WriteLine(string.Empty);
|
||||||
foreach (var record in result.DataSet)
|
foreach (var record in result.DataSet)
|
||||||
{
|
{
|
||||||
Console.WriteLine(record.FirstName);
|
Console.WriteLine($"{record.FirstName} {record.MiddleName} lives in the database");
|
||||||
Console.WriteLine(record.MiddleName);
|
Console.WriteLine($"Say hello to '{record.FirstName} {record.MiddleName}'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -51,7 +58,7 @@ namespace EonaCat.Sql
|
||||||
Console.WriteLine(result.Exception);
|
Console.WriteLine(result.Exception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Console.ReadLine();
|
Console.Read();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,8 +5,27 @@
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<ImplicitUsings>disable</ImplicitUsings>
|
<ImplicitUsings>disable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||||
|
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
|
||||||
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
|
<PackageIcon>icon.png</PackageIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="..\..\..\EonaCat.Sql\EonaCat.Sql\icon.png">
|
||||||
|
<Pack>True</Pack>
|
||||||
|
<PackagePath>\</PackagePath>
|
||||||
|
</None>
|
||||||
|
<None Include="..\..\..\EonaCat.Sql\LICENSE">
|
||||||
|
<Pack>True</Pack>
|
||||||
|
<PackagePath>\</PackagePath>
|
||||||
|
</None>
|
||||||
|
<None Include="..\..\..\EonaCat.Sql\README.md">
|
||||||
|
<Pack>True</Pack>
|
||||||
|
<PackagePath>\</PackagePath>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.0.0" />
|
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
|
||||||
|
@ -14,6 +33,10 @@
|
||||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
|
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\EonaCat.Sql\EonaCat.Sql\EonaCat.Sql.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="EonaCat.Helpers">
|
<Reference Include="EonaCat.Helpers">
|
||||||
<HintPath>..\..\..\EonaCat.Helpers\EonaCat.Helpers\bin\Debug\net6.0\EonaCat.Helpers.dll</HintPath>
|
<HintPath>..\..\..\EonaCat.Helpers\EonaCat.Helpers\bin\Debug\net6.0\EonaCat.Helpers.dll</HintPath>
|
||||||
|
@ -21,9 +44,6 @@
|
||||||
<Reference Include="EonaCat.Logger">
|
<Reference Include="EonaCat.Logger">
|
||||||
<HintPath>..\..\..\EonaCat.Logger\EonaCat.Logger\bin\Release\net6.0\EonaCat.Logger.dll</HintPath>
|
<HintPath>..\..\..\EonaCat.Logger\EonaCat.Logger\bin\Release\net6.0\EonaCat.Logger.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EonaCat.Sql">
|
|
||||||
<HintPath>..\..\..\EonaCat.Sql\EonaCat.Sql\bin\Release\net6.0\EonaCat.Sql.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.0.32112.339
|
VisualStudioVersion = 17.0.32112.339
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqlTester", "SqlTester.csproj", "{D5E2E874-0FD2-4481-BE8C-517C382342AE}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SqlTester", "SqlTester.csproj", "{D5E2E874-0FD2-4481-BE8C-517C382342AE}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EonaCat.Sql", "..\..\..\EonaCat.Sql\EonaCat.Sql\EonaCat.Sql.csproj", "{4C66F87A-3BAB-457B-A77E-92F180586E9B}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
@ -15,6 +17,10 @@ Global
|
||||||
{D5E2E874-0FD2-4481-BE8C-517C382342AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{D5E2E874-0FD2-4481-BE8C-517C382342AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{D5E2E874-0FD2-4481-BE8C-517C382342AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{D5E2E874-0FD2-4481-BE8C-517C382342AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{D5E2E874-0FD2-4481-BE8C-517C382342AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
{D5E2E874-0FD2-4481-BE8C-517C382342AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{4C66F87A-3BAB-457B-A77E-92F180586E9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{4C66F87A-3BAB-457B-A77E-92F180586E9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{4C66F87A-3BAB-457B-A77E-92F180586E9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{4C66F87A-3BAB-457B-A77E-92F180586E9B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
Loading…
Reference in New Issue