-
Notifications
You must be signed in to change notification settings - Fork 2
Description
QueryResult Class Specification
The QueryResult class represents the result of a query that returns a paginated list of items of type T. The QueryResult object includes a list of items, pagination information, and additional metadata about the query result.
Description
The QueryResult class represents the result of a query that returns a paginated list of items of type T. The QueryResult object includes a list of items, pagination information, and additional metadata about the query result.
Properties
The QueryResult class should have the following properties:
Items: A list of items of type T that represents the items returned by the query.
Pagination: A Pagination object that represents the pagination information for the query result.
Metadata: A dictionary that includes additional metadata about the query result.
public class Pagination
{
public int PageNumber { get; }
public int PageSize { get; }
public int TotalItems { get; }
public int TotalPages { get; }
public Pagination(int pageNumber, int pageSize, int totalItems)
{
PageNumber = pageNumber;
PageSize = pageSize;
TotalItems = totalItems;
TotalPages = (int)Math.Ceiling((double)totalItems / pageSize);
}
}