Skip to content

Commit fe33fc1

Browse files
committed
[ksqlDb.RestApi.Client]: added KSqlDBRestApiClientOptions to samples
1 parent 535b13c commit fe33fc1

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

Samples/ksqlDB.RestApi.Client.Sample/Program.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@ public static async Task Main(string[] args)
7474

7575
var httpClientFactory = new HttpClientFactory(new Uri(ksqlDbUrl));
7676

77-
var restApiProvider = new KSqlDbRestApiProvider(httpClientFactory, loggerFactory)
77+
var restApiClientOptions = new KSqlDBRestApiClientOptions
78+
{
79+
ShouldPluralizeFromItemName = true,
80+
};
81+
var restApiClient = new KSqlDbRestApiClient(httpClientFactory, restApiClientOptions, loggerFactory);
82+
83+
var restApiProvider = new KSqlDbRestApiProvider(httpClientFactory, restApiClientOptions, loggerFactory)
7884
{
7985
DisposeHttpClient = false
8086
};

Samples/ksqlDB.RestApi.Client.Sample/Providers/KSqlDbRestApiProvider.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using ksqlDB.RestApi.Client.KSql.RestApi;
1+
using ksqlDB.RestApi.Client.KSql.Query.Context;
2+
using ksqlDB.RestApi.Client.KSql.RestApi;
23
using ksqlDB.RestApi.Client.KSql.RestApi.Http;
34
using Microsoft.Extensions.Logging;
45
using IHttpClientFactory = ksqlDB.RestApi.Client.KSql.RestApi.Http.IHttpClientFactory;
@@ -7,8 +8,8 @@ namespace ksqlDB.RestApi.Client.Samples.Providers;
78

89
public class KSqlDbRestApiProvider : KSqlDbRestApiClient, IKSqlDbRestApiProvider
910
{
10-
public KSqlDbRestApiProvider(IHttpClientFactory httpClientFactory, ILoggerFactory? loggerFactory = null)
11-
: base(httpClientFactory, loggerFactory)
11+
public KSqlDbRestApiProvider(IHttpClientFactory httpClientFactory, KSqlDBRestApiClientOptions restApiClientOptions, ILoggerFactory? loggerFactory = null)
12+
: base(httpClientFactory, restApiClientOptions, loggerFactory)
1213
{
1314
}
1415

@@ -33,6 +34,6 @@ public static KSqlDbRestApiProvider Create(string? ksqlDbUrl = null)
3334
BaseAddress = uri
3435
};
3536

36-
return new KSqlDbRestApiProvider(new HttpClientFactory(httpClient));
37+
return new KSqlDbRestApiProvider(new HttpClientFactory(httpClient), new KSqlDBRestApiClientOptions());
3738
}
38-
}
39+
}

Samples/ksqlDB.RestApi.Client.Sample/ksqlDB.RestApi.Client.Samples.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<!-- <PackageReference Include="ksqlDb.RestApi.Client" Version="6.1.0" /> -->
13-
<ProjectReference Include="..\..\ksqlDb.RestApi.Client\ksqlDb.RestApi.Client.csproj" />
12+
<PackageReference Include="ksqlDb.RestApi.Client" Version="6.2.0" />
13+
<!-- <ProjectReference Include="..\..\ksqlDb.RestApi.Client\ksqlDb.RestApi.Client.csproj" /> -->
1414
<!-- <PackageReference Include="ksqlDb.RestApi.Client.ProtoBuf" Version="4.0.0" /> -->
1515
<ProjectReference Include="..\..\ksqlDb.RestApi.Client.ProtoBuf\ksqlDb.RestApi.Client.ProtoBuf.csproj" />
1616

ksqlDb.RestApi.Client/ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
- `DropFromItemProperties`
1717
- If `ShouldPluralizeEntityName` is null, the methods will set it using the value from the `KSqlDBRestApiClientOptions`.
1818

19-
# BugFix
19+
## BugFix
2020
- `KSqlDBContext` removed `!NETSTANDARD` pragma from `OnDisposeAsync`
2121

2222
# 6.1.0

0 commit comments

Comments
 (0)