Skip to content

Conversation

@Rick-Anderson
Copy link
Contributor

@Rick-Anderson Rick-Anderson commented Apr 5, 2025

Comment on lines +1 to +6
using Microsoft.AspNetCore.Mvc;
using System.Runtime.CompilerServices;
using System.Net.ServerSentEvents;

[ApiController]
[Route("[controller]")]
Copy link
Contributor Author

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);
}
Copy link
Contributor Author

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

Copy link
Contributor

@mikekistler mikekistler left a 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!

Copy link
Contributor

@mikekistler mikekistler left a 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.

Comment on lines 153 to 154
#### Problem

Copy link
Contributor

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?

@Rick-Anderson Rick-Anderson enabled auto-merge (squash) April 10, 2025 00:30
@Rick-Anderson Rick-Anderson merged commit 45a33f8 into main Apr 10, 2025
3 checks passed
@Rick-Anderson Rick-Anderson deleted the sse/responses/2 branch April 10, 2025 00:31
wadepickett added a commit that referenced this pull request Apr 10, 2025
* 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]>
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 this pull request may close these issues.

Document Server Sent Event result type support in minimal APIs

3 participants