Skip to content

Commit a35b9ed

Browse files
authored
Merge pull request #22 from HeroBalancer/ParameterFix
Fixes issue #20 reported by @TruDan
2 parents 0fa560a + e455243 commit a35b9ed

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

fusionauth-netcore-client/src/io/fusionauth/DefaultRESTClient.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DefaultRESTClient : IRESTClient {
3636

3737
public String uri = "";
3838

39-
public Dictionary<string, string> parameters = new Dictionary<string, string>();
39+
public List<KeyValuePair<string, string>> parameters = new List<KeyValuePair<string, string>>();
4040

4141
public Dictionary<string, string> headers = new Dictionary<string, string>();
4242

@@ -146,7 +146,7 @@ public override IRESTClient withUri(string uri) {
146146
* @param value The value of the parameter, may be a string, object or number.
147147
*/
148148
public override IRESTClient withParameter(string name, string value) {
149-
parameters[name] = value;
149+
parameters.Add(new KeyValuePair<string, string>(name, value));
150150
return this;
151151
}
152152

fusionauth-netcore-client/src/io/fusionauth/IRESTClient.cs

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616

1717
using System;
18+
using System.Collections.Generic;
19+
using System.Linq;
1820
using System.Net.Http;
1921
using System.Threading.Tasks;
2022

@@ -101,6 +103,14 @@ public IRESTClient withParameter(string name, object value) {
101103
return withParameter(name, value.ToString());
102104
}
103105

106+
public IRESTClient withParameter<T>(string name, IEnumerable<T> value)
107+
{
108+
if (value == null)
109+
return this;
110+
111+
return value.Aggregate(this, (current, val) => current.withParameter(name, val));
112+
}
113+
104114
/**
105115
* Run the request and return a promise. This promise will resolve if the request is successful
106116
* and reject otherwise.

0 commit comments

Comments
 (0)