Updated
This commit is contained in:
parent
86d13cce04
commit
b1c1526363
|
@ -1,5 +1,7 @@
|
|||
|
||||
using EonaCat.Sql.Extensions;
|
||||
using System;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace EonaCat.Sql
|
||||
{
|
||||
|
@ -11,6 +13,24 @@ namespace EonaCat.Sql
|
|||
var test = new EonaCat.Logger.Managers.LogManager();
|
||||
test.Write("test", EonaCat.Logger.ELogType.ERROR);
|
||||
Console.WriteLine(errors);
|
||||
|
||||
TestsqlServer();
|
||||
}
|
||||
|
||||
private static async void TestsqlServer()
|
||||
{
|
||||
var customerId = "AROUT";
|
||||
var result = SqlHelper.ExecuteQuery(
|
||||
@"Server=localhost;Database=NorthWind;User Id=sa;Password=jeroen;TrustServerCertificate=Yes;",
|
||||
$"SELECT * FROM Customers WHERE CustomerID = @0 AND Country = @1"
|
||||
, true, customerId, "UK");
|
||||
|
||||
foreach (var record in result)
|
||||
{
|
||||
Console.WriteLine(record.CustomerID);
|
||||
Console.WriteLine(record.ContactTitle);
|
||||
}
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,13 +8,15 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="EonaCat.Sql">
|
||||
<HintPath>..\..\..\EonaCat.Sql\bin\Release\netstandard2.1\EonaCat.Sql.dll</HintPath>
|
||||
<HintPath>..\..\..\EonaCat.Sql\bin\Release\net6.0\EonaCat.Sql.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EonaCatLogger">
|
||||
<HintPath>..\..\..\EonaCatLogger\bin\Release\net6.0\EonaCatLogger.dll</HintPath>
|
||||
|
|
Loading…
Reference in New Issue