From 5cdd637faf3fc45151dd7b4059500a9440fdc1f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=A4felfinger?= Date: Fri, 7 Oct 2022 23:11:28 +0200 Subject: [PATCH] consolidates extension methods --- .../CapturedMultipartContentExtensions.cs | 16 ---------------- PiwigoDotnet/Piwigo.Client/PiwigoMethods.cs | 10 ++++++++++ 2 files changed, 10 insertions(+), 16 deletions(-) delete mode 100644 PiwigoDotnet/Piwigo.Client/CapturedMultipartContentExtensions.cs diff --git a/PiwigoDotnet/Piwigo.Client/CapturedMultipartContentExtensions.cs b/PiwigoDotnet/Piwigo.Client/CapturedMultipartContentExtensions.cs deleted file mode 100644 index fb56758..0000000 --- a/PiwigoDotnet/Piwigo.Client/CapturedMultipartContentExtensions.cs +++ /dev/null @@ -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); - } -} \ No newline at end of file diff --git a/PiwigoDotnet/Piwigo.Client/PiwigoMethods.cs b/PiwigoDotnet/Piwigo.Client/PiwigoMethods.cs index 0ec2717..49b9b31 100644 --- a/PiwigoDotnet/Piwigo.Client/PiwigoMethods.cs +++ b/PiwigoDotnet/Piwigo.Client/PiwigoMethods.cs @@ -19,4 +19,14 @@ internal static class PiwigoMethods { 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); + } } \ No newline at end of file