Skip to content

QueryResult #5

@KSemenenko

Description

@KSemenenko

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);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions