| 6 | namespace API.Extensions; |
| 7 | |
| 8 | public static class HttpExtensions |
| 9 | { |
| 10 | public static void AddPaginationHeader(this HttpResponse response, PaginationMetadata metadata) |
| 11 | { |
| 12 | var options = new JsonSerializerOptions{PropertyNamingPolicy = JsonNamingPolicy.CamelCase}; |
| 13 | |
| 14 | response.Headers.Append("Pagination", JsonSerializer.Serialize(metadata, options)); |
| 15 | response.Headers.Append(HeaderNames.AccessControlExposeHeaders, "Pagination"); |
| 16 | } |
| 17 | } |
nothing calls this directly
no outgoing calls
no test coverage detected