consolidates extension methods
This commit is contained in:
parent
5f7f6f6efa
commit
5cdd637faf
@ -1,16 +0,0 @@
|
|||||||
using Flurl.Http.Content;
|
|
||||||
|
|
||||||
namespace Piwigo.Client;
|
|
||||||
|
|
||||||
internal static class CapturedMultipartContentExtensions
|
|
||||||
{
|
|
||||||
public static CapturedMultipartContent AddMethod(this CapturedMultipartContent part, string piwigoMethod)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(piwigoMethod))
|
|
||||||
{
|
|
||||||
throw new ArgumentException("Value cannot be null or whitespace.", nameof(piwigoMethod));
|
|
||||||
}
|
|
||||||
|
|
||||||
return part.AddString("method", piwigoMethod);
|
|
||||||
}
|
|
||||||
}
|
|
@ -19,4 +19,14 @@ internal static class PiwigoMethods
|
|||||||
{
|
{
|
||||||
return part.AddMethod("pwg.session.getStatus");
|
return part.AddMethod("pwg.session.getStatus");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static CapturedMultipartContent AddMethod(this CapturedMultipartContent part, string piwigoMethod)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(piwigoMethod))
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Value cannot be null or whitespace.", nameof(piwigoMethod));
|
||||||
|
}
|
||||||
|
|
||||||
|
return part.AddString("method", piwigoMethod);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user