Skip to content

Commit 032a19b

Browse files
committed
fix issue with overload resolving
1 parent 5ca67c4 commit 032a19b

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/FluentRest/QueryBuilder.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,13 @@ public TBuilder AppendPath<TValue>(TValue path)
227227
/// </summary>
228228
/// <param name="paths">The paths to append.</param>
229229
/// <returns>A fluent request builder.</returns>
230-
public TBuilder AppendPath(IEnumerable<string> paths)
230+
public TBuilder AppendPaths(IEnumerable<string> paths)
231231
{
232232
if (paths == null)
233233
return this as TBuilder;
234234

235235
var urlBuilder = RequestMessage.GetUrlBuilder();
236-
urlBuilder.AppendPath(paths);
236+
urlBuilder.AppendPaths(paths);
237237

238238
RequestMessage.Synchronize();
239239

@@ -245,7 +245,7 @@ public TBuilder AppendPath(IEnumerable<string> paths)
245245
/// </summary>
246246
/// <param name="paths">The paths to append.</param>
247247
/// <returns>A fluent request builder.</returns>
248-
public TBuilder AppendPath(params string[] paths)
248+
public TBuilder AppendPaths(params string[] paths)
249249
{
250250
if (paths == null)
251251
return this as TBuilder;
@@ -384,7 +384,7 @@ public TBuilder QueryString<TValue>(string name, TValue value)
384384
/// A fluent request builder.
385385
/// </returns>
386386
/// <exception cref="System.ArgumentNullException"><paramref name="name" /> is <see langword="null" />.</exception>
387-
public TBuilder QueryString<TValue>(string name, IEnumerable<TValue> values)
387+
public TBuilder QueryStrings<TValue>(string name, IEnumerable<TValue> values)
388388
{
389389
if (name == null)
390390
throw new ArgumentNullException(nameof(name));

src/FluentRest/UrlBuilder.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public UrlBuilder AppendPath<TValue>(TValue path)
360360
/// </summary>
361361
/// <param name="paths">The path segments to append.</param>
362362
/// <returns></returns>
363-
public UrlBuilder AppendPath(IEnumerable<string> paths)
363+
public UrlBuilder AppendPaths(IEnumerable<string> paths)
364364
{
365365
if (paths == null)
366366
return this;
@@ -462,7 +462,7 @@ public UrlBuilder AppendQuery<TValue>(string name, TValue value)
462462
/// <param name="values">The query string values.</param>
463463
/// <returns></returns>
464464
/// <exception cref="ArgumentNullException">name is <c>null</c></exception>
465-
public UrlBuilder AppendQuery<TValue>(string name, IEnumerable<TValue> values)
465+
public UrlBuilder AppendQueries<TValue>(string name, IEnumerable<TValue> values)
466466
{
467467
if (name == null)
468468
throw new ArgumentNullException(nameof(name));

test/FluentRest.Tests/QueryBuilderTest.cs

+7-5
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ public void QueryStringMultipleList()
4444
var request = new HttpRequestMessage();
4545
var builder = new QueryBuilder(request);
4646

47+
var list = new List<int> { 1, 2 };
48+
4749
builder.BaseUri("http://test.com/");
48-
builder.QueryString("Test", ["Test1", "Test2"]);
50+
builder.QueryStrings("Test", list);
4951

5052
var uri = request.GetUrlBuilder();
5153

52-
Assert.Equal("http://test.com/?Test=Test1&Test=Test2", uri.ToString());
54+
Assert.Equal("http://test.com/?Test=1&Test=2", uri.ToString());
5355
}
5456

5557
[Fact]
@@ -126,7 +128,7 @@ public void AppendParamsArrayPaths()
126128
var request = new HttpRequestMessage();
127129
var builder = new QueryBuilder(request);
128130

129-
builder.BaseUri("http://test.com/api/").AppendPath("v1", "bar");
131+
builder.BaseUri("http://test.com/api/").AppendPaths("v1", "bar");
130132

131133
var urlBuilder = request.GetUrlBuilder();
132134

@@ -139,8 +141,8 @@ public void AppendEnumerablePaths()
139141
var request = new HttpRequestMessage();
140142
var builder = new QueryBuilder(request);
141143

142-
IEnumerable<string> enumerablePaths = new List<string>(new[] { "v1", "bar" });
143-
builder.BaseUri("http://test.com/api/").AppendPath(enumerablePaths);
144+
var enumerablePaths = new List<string>(["v1", "bar"]);
145+
builder.BaseUri("http://test.com/api/").AppendPaths(enumerablePaths);
144146

145147
var urlBuilder = request.GetUrlBuilder();
146148

0 commit comments

Comments
 (0)