-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
CarterOptions() before lambda expression on 5.1.0 #253
Comments
This was done on v5.0.0 and was a breaking change
#149
We recommend that you use middleware to do this:
app.Use(async (context, next) =>
{
// Do work that doesn't write to the Response.
await next.Invoke();
// Do logging or other work that doesn't write to the Response.
});
…On Thu, 2 Jul 2020 at 16:17, Heitor Ribeiro de Souza < ***@***.***> wrote:
Hi all
On previous carter version, we had the possibility to, inside the
Configure method of Startup.cs create a lambda expression inside the
app.UserCarter() to inject something on the header response of every call
to our api.
So basically the call was something like that:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseCarter(new CarterOptions(before: ctx => Inject(ctx)))
}
private Task<bool> Inject(HttpContext ctx)
{
ctx.Response.Headers["our-api-header"] = ((int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds).ToString();
return Task.FromResult(true);
}
This is something that was possible on old version of carter. But, on the
new one, I didn't see any option like that. So, my question is: is that
something like that on Carter 5.1.0? Or it was removed?
Thanks in advanced
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#253>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZVJXMKCNG5DUC7VKQMV3RZSQJZANCNFSM4OO7WBNQ>
.
|
Got it John! Thanks a lot for the clarification about that issue. I'm closing this thread. |
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all
On previous carter version, we had the possibility to, inside the Configure method of Startup.cs create a lambda expression inside the app.UserCarter() to inject something on the header response of every call to our api.
So basically the call was something like that:
This is something that was possible on old version of carter. But, on the new one, I didn't see any option like that. So, my question is: is that something like that on Carter 5.1.0? Or it was removed?
Thanks in advanced
The text was updated successfully, but these errors were encountered: