Files

28 lines
899 B
C#

using System.Text.Json.Serialization;
namespace Elternbeirat.PocketBase;
/// <summary>
/// The envelope PocketBase wraps a records list response in.
/// </summary>
/// <remarks>
/// Only <see cref="Items"/> is mapped. The paging fields (<c>page</c>,
/// <c>perPage</c>, <c>totalItems</c>, <c>totalPages</c>) are ignored, because
/// content volumes are small and <see cref="PocketBaseClient"/> fetches every
/// record in a single request.
/// </remarks>
/// <typeparam name="T">
/// The record type inside <c>items</c>.
/// </typeparam>
internal sealed record RecordList<T>
{
/// <summary>
/// Gets the records of the requested page.
/// </summary>
/// <value>
/// The records, or an empty list if the collection has no matching records.
/// </value>
[JsonPropertyName("items")]
public IReadOnlyList<T> Items { get; init; } = [];
}