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

InvalidOperationException: HttpContext is required. in pagination service constructor. #9

Closed
ugumerie opened this issue May 20, 2023 · 5 comments · Fixed by #11
Closed

Comments

@ugumerie
Copy link

Hello,

Is there any way one can make injection of the IHttpContextAccessor into PaginationService optional when using outside of httpcontext.

For example, I'm using masstransit to publish integration events to rabbitmq, on getting to one of the consumers or receive endpoints, that called a method using IPaginationService, it tried constructing the IPaginationService and threw InvalidOperationException, "HttpContext is Required". I feel because it is outside the scope of httpcontext. Though I want create my own implementation using just the first overload with KeysetQueryModel object without injecting IHttpContextAccessor.

Regards

@mrahhal
Copy link
Owner

mrahhal commented May 20, 2023

Hello,

That makes sense. Should move the exception throwing from the ctor to only the places that actually need HttpContext.

@Ngreene-mwks
Copy link

Ngreene-mwks commented Jan 26, 2024

Having the same issue.
I would push up a fix, but seem unable to, getting 403.
Can we get a resolution on this please?

@mrahhal
Copy link
Owner

mrahhal commented Jan 26, 2024

Will be released soon.

@mrahhal
Copy link
Owner

mrahhal commented Jan 27, 2024

Released in v3.0.0.

@Ngreene-mwks
Copy link

Ngreene-mwks commented Jan 27, 2024

Thanks! Appreciate all the work!

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

Successfully merging a pull request may close this issue.

3 participants