tgstation-server 5.12.7
The /tg/station 13 server suite
Loading...
Searching...
No Matches
PaginatableResult.cs
Go to the documentation of this file.
1using System;
2using System.Linq;
3
4using Microsoft.AspNetCore.Mvc;
5
7{
12 public sealed class PaginatableResult<TModel>
13 {
17 public IOrderedQueryable<TModel> Results { get; }
18
22 public IActionResult EarlyOut { get; }
23
28 public PaginatableResult(IOrderedQueryable<TModel> results)
29 {
30 Results = results ?? throw new ArgumentNullException(nameof(results));
31 }
32
37 public PaginatableResult(IActionResult earlyOut)
38 {
39 EarlyOut = earlyOut ?? throw new ArgumentNullException(nameof(earlyOut));
40 }
41 }
42}
Helper for returning paginated models.
PaginatableResult(IOrderedQueryable< TModel > results)
Initializes a new instance of the PaginatableResult<TModel> class.
PaginatableResult(IActionResult earlyOut)
Initializes a new instance of the PaginatableResult<TModel> class.
IActionResult EarlyOut
An IActionResult to return immediately.
IOrderedQueryable< TModel > Results
The IOrderedQueryable<T> TModel results.