From 48b5602144d752b183d260ec255465a436703904 Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Mon, 29 Jul 2024 07:38:15 -0600 Subject: [PATCH] Enable nullability for QueryResult --- MediaBrowser.Model/Querying/QueryResult.cs | 85 +++++++++++++--------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/MediaBrowser.Model/Querying/QueryResult.cs b/MediaBrowser.Model/Querying/QueryResult.cs index ea843f34cd..dd0d4fbfcf 100644 --- a/MediaBrowser.Model/Querying/QueryResult.cs +++ b/MediaBrowser.Model/Querying/QueryResult.cs @@ -1,47 +1,60 @@ -#nullable disable -#pragma warning disable CS1591 - using System; using System.Collections.Generic; -namespace MediaBrowser.Model.Querying +namespace MediaBrowser.Model.Querying; + +/// +/// Query result container. +/// +/// The type of item contained in the query result. +public class QueryResult { - public class QueryResult + /// + /// Initializes a new instance of the class. + /// + public QueryResult() { - public QueryResult() - { - Items = Array.Empty(); - } + Items = Array.Empty(); + } - public QueryResult(IReadOnlyList items) - { - Items = items; - TotalRecordCount = items.Count; - } + /// + /// Initializes a new instance of the class. + /// + /// The list of items. + public QueryResult(IReadOnlyList items) + { + Items = items; + TotalRecordCount = items.Count; + } - public QueryResult(int? startIndex, int? totalRecordCount, IReadOnlyList items) - { - StartIndex = startIndex ?? 0; - TotalRecordCount = totalRecordCount ?? items.Count; - Items = items; - } + /// + /// 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 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 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; } - } + /// + /// Gets or sets the index of the first record in Items. + /// + /// First record index. + public int StartIndex { get; set; } }