Skip to content

Commit

Permalink
Automated dotnet-format update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 17, 2024
1 parent 406579c commit 4ec50f8
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace BUTR.Site.NexusMods.Server.Utils.Csv.Utils;

public class ExportOutputFormatter<TCsvFile> : TextOutputFormatter where TCsvFile: ICsvFile
public class ExportOutputFormatter<TCsvFile> : TextOutputFormatter where TCsvFile : ICsvFile
{
private static string ContentType => "text/csv";

Expand Down Expand Up @@ -42,11 +42,11 @@ public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext co
};
if (data is null || type is null)
throw new InvalidOperationException("Invalid csv data type!");
await WriteCsvCollection(context.HttpContext, data, selectedEncoding);

await WriteCsvCollectionAsync(context.HttpContext, data, selectedEncoding);
}

private static async Task WriteCsvCollection(HttpContext context, IEnumerable<TCsvFile> entries, Encoding selectedEncoding)
private static async Task WriteCsvCollectionAsync(HttpContext context, IEnumerable<TCsvFile> entries, Encoding selectedEncoding)
{
var response = context.Response;

Expand All @@ -57,7 +57,7 @@ private static async Task WriteCsvCollection(HttpContext context, IEnumerable<TC
}.ToString();

await using var csv = new CsvWriter(new StreamWriter(response.Body, selectedEncoding), CultureInfo.InvariantCulture);

csv.WriteHeader<TCsvFile>();
await csv.NextRecordAsync();
await csv.WriteRecordsAsync(entries);
Expand Down

0 comments on commit 4ec50f8

Please sign in to comment.