Skip to content

Support passing up CancellationTokens to ToPagedListAsync(). #25

@VictorioBerra

Description

@VictorioBerra

ASPNET Core automatically wires up a CancellationToken in your controller actions, so it would be really helpful if we could add ToListAsync() to the paging stuff.

MVC will automatically bind any CancellationToken parameters in an action method to the HttpContext.RequestAborted token, using the CancellationTokenModelBinder. This model binder is registered automatically when you call services.AddMvc() (or services.AddMvcCore()) in Startup.ConfigureServices().
via https://andrewlock.net/using-cancellationtokens-in-asp-net-core-mvc-controllers/

We would put it here and pass it all the way up to the calling code https://github.com/AlexanderKrutov/DataTables.Queryable/blob/master/DataTables.Queryable/PagedList.cs#L78 and this way we could avoid doing Task.Factory stuff like here https://github.com/AlexanderKrutov/DataTables.Queryable/blob/master/DataTables.Queryable/QueryableExtensions.cs#L78

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions