diff --git a/templates/dotnet/src/Appwrite/Client.cs.twig b/templates/dotnet/src/Appwrite/Client.cs.twig index 96420a1c4..8b1f77677 100644 --- a/templates/dotnet/src/Appwrite/Client.cs.twig +++ b/templates/dotnet/src/Appwrite/Client.cs.twig @@ -115,9 +115,17 @@ namespace {{ spec.title | caseUcfirst }} form.Add(new ByteArrayContent(file, 0, file.Length), "file", fi.Name); } + else if (parameter.Value is IEnumerable) + { + List list = new List((IEnumerable) parameter.Value); + for (int index = 0; index < list.Count; index++) + { + form.Add(new StringContent(list[index].ToString()), $"{parameter.Key}[{index}]"); + } + } else { - form.Add(new StringContent(parameter.Key), parameter.Value?.ToString()); + form.Add(new StringContent(parameter.Value.ToString()), parameter.Key); } } request.Content = form; diff --git a/tests/SDKTest.php b/tests/SDKTest.php index 4a712c0b9..69d84e476 100644 --- a/tests/SDKTest.php +++ b/tests/SDKTest.php @@ -76,8 +76,8 @@ class SDKTest extends TestCase 'dotnet-5.0' => 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/dotnet/src/test/ mcr.microsoft.com/dotnet/sdk:5.0-alpine pwsh tests.ps1', 'dotnet-3.1' => 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/dotnet/src/test/ mcr.microsoft.com/dotnet/sdk:3.1-alpine pwsh tests.ps1' ], - 'supportRedirect' => false, - 'supportUpload' => false, + 'supportRedirect' => true, + 'supportUpload' => true, ], 'typescript' => [ diff --git a/tests/languages/dotnet/tests.ps1 b/tests/languages/dotnet/tests.ps1 index 9b2385c77..fd1d64fa0 100644 --- a/tests/languages/dotnet/tests.ps1 +++ b/tests/languages/dotnet/tests.ps1 @@ -57,3 +57,6 @@ Print-Response $response $response = $general.Redirect() | Await-Task Print-Response $response + +$response = $general.Upload("string", 123, $list, (Get-Item "../../../../resources/file.png")) | Await-Task +Print-Response $response