원클릭으로
csharp-sse-support
// This skill describes how to implement the server part of Server-Sent Events (SSE) in modern .NET (ASP.NET Core). Use this skill when the user asks about "SSE in .NET / ASP.NET Core".
// This skill describes how to implement the server part of Server-Sent Events (SSE) in modern .NET (ASP.NET Core). Use this skill when the user asks about "SSE in .NET / ASP.NET Core".
Angular and TypeScript coding guidelines for building maintainable, performant, and accessible web applications. Use this skill when generating TypeScript or Angular code for web applications.
C# / .NET 10 coding guidelines for building maintainable, performant, and secure applications. Use this skill when generating C# or .NET code for applications.
Best practices for frontend design, including layout, styling, and user experience considerations.
| name | csharp-sse-support |
| description | This skill describes how to implement the server part of Server-Sent Events (SSE) in modern .NET (ASP.NET Core). Use this skill when the user asks about "SSE in .NET / ASP.NET Core". |
ASP.NET Core Minimal APIs have built-in SSE result support in ASP.NET Core 10 via Results.ServerSentEvents(...) / TypedResults.ServerSentEvents(...) returning a ServerSentEventsResult<T> from an IAsyncEnumerable.
Minimal API example (strings)
app.MapGet("/events", () =>
{
async IAsyncEnumerable<string> Stream([System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken ct = default)
{
while (!ct.IsCancellationRequested)
{
yield return $"Server time: {DateTimeOffset.UtcNow:O}";
await Task.Delay(1000, ct);
}
}
// Sends SSE data using built-in result support
return Results.ServerSentEvents(Stream());
});