-
Notifications
You must be signed in to change notification settings - Fork 25.1k
SSE return types /2 #35152
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
SSE return types /2 #35152
Conversation
| using Microsoft.AspNetCore.Mvc; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Net.ServerSentEvents; | ||
|
|
||
| [ApiController] | ||
| [Route("[controller]")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikekistler should I remove the controller sample? If not, where should I surface it?
| public record HeartRateRecord(DateTime Timestamp, int HeartRate) | ||
| { | ||
| public static HeartRateRecord Create(int heartRate) => new(DateTime.UtcNow, heartRate); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the name from HearRate to HeartRateRecord
see original https://github.com/captainsafia/minapi-sse/blob/main/Program.cs#L60-L63
mikekistler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good but I think a few changes will make it great!
Co-authored-by: Mike Kistler <[email protected]>
Co-authored-by: Mike Kistler <[email protected]>
mikekistler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
I left a couple minor comments but fine to let you decide whether/how to resolve them.
aspnetcore/web-api/action-return-types/samples/10/ControllerSSE/HearRate.cs
Outdated
Show resolved
Hide resolved
| #### Problem | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you planning to put something here?
…E/HearRate.cs Co-authored-by: Mike Kistler <[email protected]>
* Adds .NET 9 sample to mongo app (#35189) * copy-paste to 9.x * update code to .NET 9 * update references to code * update references to 8.x code * upate ms date * add missing snapshot * Update aspnetcore/tutorials/first-mongo-app.md --------- Co-authored-by: Wade Pickett <[email protected]> * SSE return types /2 (#35152) * SSE return types /2 * SSE return types /2 * SSE return types /2 * SSE return types /2 * SSE return types /2 * fixes * Update aspnetcore/fundamentals/minimal-apis/responses.md Co-authored-by: Mike Kistler <[email protected]> * Apply suggestions from code review Co-authored-by: Mike Kistler <[email protected]> * react to feedback * Update aspnetcore/web-api/action-return-types/samples/10/ControllerSSE/HearRate.cs Co-authored-by: Mike Kistler <[email protected]> * react to feedback --------- Co-authored-by: Mike Kistler <[email protected]> * Update complex-data-model.md Fixes #35191 * WN .NET 10 Prev 3: Validation Support Minimal API (#35188) * WN .NET 10 Prev 3: Validation Support Minimal API * Added include to What's New topic for .NET 10 Preview 3 * Update with correct links * Format link for attribute * Correct DataAnnotations link * Add review suggestions, remove future tense and lines * Minor edit * Remove line breaks * fixed line break * [Pre3] Boot config file name change (#35176) * [Pre3] Declaratively persist state (#35198) * Blazor Pre3 final updates for release (#35200) * Patch Blazor Pre3 API (#35201) --------- Co-authored-by: Tim Deschryver <[email protected]> Co-authored-by: Wade Pickett <[email protected]> Co-authored-by: Rick Anderson <[email protected]> Co-authored-by: Mike Kistler <[email protected]> Co-authored-by: Luke Latham <[email protected]>
Fixes #35089
Support for Server-Sent Events (SSE)
Responses: Server-Sent Events (SSE)
Internal previews