using System; using System.Collections.Generic; namespace MediaBrowser.Model.Querying; /// /// Query result container. /// /// The type of item contained in the query result. public class QueryResult { /// /// Initializes a new instance of the class. /// public QueryResult() { Items = Array.Empty(); } /// /// Initializes a new instance of the class. /// /// The list of items. public QueryResult(IReadOnlyList items) { Items = items; TotalRecordCount = items.Count; } /// /// Initializes a new instance of the class. /// /// The start index that was used to build the item list. /// The total count of items. /// The list of items. public QueryResult(int? startIndex, int? totalRecordCount, IReadOnlyList items) { StartIndex = startIndex ?? 0; TotalRecordCount = totalRecordCount ?? items.Count; Items = items; } /// /// Gets or sets the items. /// /// The items. public IReadOnlyList Items { get; set; } /// /// Gets or sets the total number of records available. /// /// The total record count. public int TotalRecordCount { get; set; } /// /// Gets or sets the index of the first record in Items. /// /// First record index. public int StartIndex { get; set; } }