diff options
Diffstat (limited to 'MediaBrowser.Model/Querying/QueryResult.cs')
| -rw-r--r-- | MediaBrowser.Model/Querying/QueryResult.cs | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/MediaBrowser.Model/Querying/QueryResult.cs b/MediaBrowser.Model/Querying/QueryResult.cs index e81f2b868..8ce794800 100644 --- a/MediaBrowser.Model/Querying/QueryResult.cs +++ b/MediaBrowser.Model/Querying/QueryResult.cs @@ -1,22 +1,40 @@ +#nullable disable +#pragma warning disable CS1591 + +using System; +using System.Collections.Generic; + namespace MediaBrowser.Model.Querying { public class QueryResult<T> { + public QueryResult() + { + Items = Array.Empty<T>(); + } + + public QueryResult(IReadOnlyList<T> items) + { + Items = items; + TotalRecordCount = items.Count; + } + /// <summary> /// Gets or sets the items. /// </summary> /// <value>The items.</value> - public T[] Items { get; set; } + public IReadOnlyList<T> Items { get; set; } /// <summary> - /// The total number of records available + /// Gets or sets the total number of records available. /// </summary> /// <value>The total record count.</value> public int TotalRecordCount { get; set; } - public QueryResult() - { - Items = new T[] { }; - } + /// <summary> + /// Gets or sets the index of the first record in Items. + /// </summary> + /// <value>First record index.</value> + public int StartIndex { get; set; } } } |
