Files
pgsql-jellyfin/MediaBrowser.Model/Querying/QueryResult.cs
wjones af1152b001 Refactor: standardize namespace and using directive style
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
2026-02-20 16:26:53 -05:00

65 lines
1.9 KiB
C#

// <copyright file="QueryResult.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace MediaBrowser.Model.Querying;
using global::System;
using global::System.Collections.Generic;
/// <summary>
/// Query result container.
/// </summary>
/// <typeparam name="T">The type of item contained in the query result.</typeparam>
public class QueryResult<T>
{
/// <summary>
/// Initializes a new instance of the <see cref="QueryResult{T}" /> class.
/// </summary>
public QueryResult()
{
Items = Array.Empty<T>();
}
/// <summary>
/// Initializes a new instance of the <see cref="QueryResult{T}" /> class.
/// </summary>
/// <param name="items">The list of items.</param>
public QueryResult(IReadOnlyList<T> items)
{
Items = items;
TotalRecordCount = items.Count;
}
/// <summary>
/// Initializes a new instance of the <see cref="QueryResult{T}" /> class.
/// </summary>
/// <param name="startIndex">The start index that was used to build the item list.</param>
/// <param name="totalRecordCount">The total count of items.</param>
/// <param name="items">The list of items.</param>
public QueryResult(int? startIndex, int? totalRecordCount, IReadOnlyList<T> items)
{
StartIndex = startIndex ?? 0;
TotalRecordCount = totalRecordCount ?? items.Count;
Items = items;
}
/// <summary>
/// Gets or sets the items.
/// </summary>
/// <value>The items.</value>
public IReadOnlyList<T> Items { get; set; }
/// <summary>
/// Gets or sets the total number of records available.
/// </summary>
/// <value>The total record count.</value>
public int TotalRecordCount { get; set; }
/// <summary>
/// Gets or sets the index of the first record in Items.
/// </summary>
/// <value>First record index.</value>
public int StartIndex { get; set; }
}