2020-04-05 16:10:56 +00:00
|
|
|
#nullable disable
|
2020-02-04 00:49:27 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-09-02 06:19:29 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
namespace MediaBrowser.Model.Querying
|
|
|
|
{
|
|
|
|
public class QueryResult<T>
|
|
|
|
{
|
2021-02-20 22:13:04 +00:00
|
|
|
public QueryResult()
|
|
|
|
{
|
|
|
|
Items = Array.Empty<T>();
|
|
|
|
}
|
|
|
|
|
|
|
|
public QueryResult(IReadOnlyList<T> items)
|
|
|
|
{
|
|
|
|
Items = items;
|
|
|
|
TotalRecordCount = items.Count;
|
|
|
|
}
|
|
|
|
|
2022-01-20 15:46:17 +00:00
|
|
|
public QueryResult(int? startIndex, int? totalRecordCount, IReadOnlyList<T> items)
|
|
|
|
{
|
|
|
|
StartIndex = startIndex ?? 0;
|
|
|
|
TotalRecordCount = totalRecordCount ?? items.Count;
|
|
|
|
Items = items;
|
|
|
|
}
|
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the items.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The items.</value>
|
2019-09-02 06:19:29 +00:00
|
|
|
public IReadOnlyList<T> Items { get; set; }
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2021-02-20 22:13:04 +00:00
|
|
|
/// Gets or sets the total number of records available.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The total record count.</value>
|
|
|
|
public int TotalRecordCount { get; set; }
|
|
|
|
|
2019-12-10 17:30:44 +00:00
|
|
|
/// <summary>
|
2021-02-20 22:13:04 +00:00
|
|
|
/// Gets or sets the index of the first record in Items.
|
2019-12-10 17:30:44 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>First record index.</value>
|
|
|
|
public int StartIndex { get; set; }
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
}
|