diff options
| author | Cody Robibero <cody@robibe.ro> | 2023-02-04 10:21:49 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-04 10:21:49 -0700 |
| commit | d1af317d98a6190711af406af17b569844aebbd7 (patch) | |
| tree | 3422bb577d2821a9798465439e983932690aa2e3 /Jellyfin.Api/Formatters/XmlOutputFormatter.cs | |
| parent | e0519189b25bc4605889e46d9583fea9aef41732 (diff) | |
| parent | dfea1229e12764a77f5d392194b1848f80b87042 (diff) | |
Merge pull request #9215 from Shadowghost/api-scoped-namespace
Diffstat (limited to 'Jellyfin.Api/Formatters/XmlOutputFormatter.cs')
| -rw-r--r-- | Jellyfin.Api/Formatters/XmlOutputFormatter.cs | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/Jellyfin.Api/Formatters/XmlOutputFormatter.cs b/Jellyfin.Api/Formatters/XmlOutputFormatter.cs index df8b1650b..d5dea0f09 100644 --- a/Jellyfin.Api/Formatters/XmlOutputFormatter.cs +++ b/Jellyfin.Api/Formatters/XmlOutputFormatter.cs @@ -4,30 +4,29 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Formatters; -namespace Jellyfin.Api.Formatters +namespace Jellyfin.Api.Formatters; + +/// <summary> +/// Xml output formatter. +/// </summary> +public class XmlOutputFormatter : TextOutputFormatter { /// <summary> - /// Xml output formatter. + /// Initializes a new instance of the <see cref="XmlOutputFormatter"/> class. /// </summary> - public class XmlOutputFormatter : TextOutputFormatter + public XmlOutputFormatter() { - /// <summary> - /// Initializes a new instance of the <see cref="XmlOutputFormatter"/> class. - /// </summary> - public XmlOutputFormatter() - { - SupportedMediaTypes.Clear(); - SupportedMediaTypes.Add(MediaTypeNames.Text.Xml); + SupportedMediaTypes.Clear(); + SupportedMediaTypes.Add(MediaTypeNames.Text.Xml); - SupportedEncodings.Add(Encoding.UTF8); - SupportedEncodings.Add(Encoding.Unicode); - } + SupportedEncodings.Add(Encoding.UTF8); + SupportedEncodings.Add(Encoding.Unicode); + } - /// <inheritdoc /> - public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) - { - var stringResponse = context.Object?.ToString(); - return stringResponse is null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse); - } + /// <inheritdoc /> + public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) + { + var stringResponse = context.Object?.ToString(); + return stringResponse is null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse); } } |
