Skip to content

Commit 189512b

Browse files
committed
chore: use enum instead of strings for the client
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
1 parent 8efef8b commit 189512b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

petstore/dotnet/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-

1+
using KiotaSamples.PetStoreSdk.Pet.FindByStatus;
22

33

44
// ** Swagger Petstore sample
@@ -67,12 +67,12 @@
6767
// This is translated to an array, with the generated SDK. ⚡
6868
static async Task<long> FindPetsByStatus(PetstoreApiClient client, JsonSerializerOptions jsonSerializerOptions)
6969
{
70-
var statuses = new[] { "pending", "sold" }; // Mutliple statuses we are going to query on.
70+
var statuses = new[] { GetStatusQueryParameterType.Pending, GetStatusQueryParameterType.Sold }; // Multiple statuses we are going to query on.
7171

7272
// Sample curl:
7373
// curl -X 'GET' 'https://petstore.swagger.io/v2/pet/findByStatus?status=available&status=pending&status=sold' -H 'accept: application/json'
7474

75-
var results = (await client.Pet.FindByStatus.GetAsync(x => x.QueryParameters.Status = statuses))?.ToList();
75+
var results = (await client.Pet.FindByStatus.GetAsync(x => x.QueryParameters.StatusAsGetStatusQueryParameterType = statuses))?.ToList();
7676
if (results is null)
7777
{
7878
Console.WriteLine("No results found.");

0 commit comments

Comments
 (0)