Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryResult #5

Open
KSemenenko opened this issue Mar 12, 2023 · 0 comments
Open

QueryResult #5

KSemenenko opened this issue Mar 12, 2023 · 0 comments

Comments

@KSemenenko
Copy link
Member

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);
    }
}
KSemenenko added a commit that referenced this issue Mar 14, 2023
KSemenenko added a commit that referenced this issue Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant