-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.dotnet-fundamentals/svcokr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Description
Type of issue
Missing information
Description
In the section https://learn.microsoft.com/en-us/dotnet/core/extensions/windows-service#rewrite-the-worker-class
the code shown, is using Primary constructor. In the description it states that:
Both are made available to the class as private readonly
a) This is not what the code is showing.
b) Primary constructors are not private readonly.
It should state that we are using primary constructors, and/or adding an example on how to assign them to private
readonly
fields like so:
public sealed class WindowsBackgroundService(
JokeService JokeService,
ILogger<WindowsBackgroundService> logger) : BackgroundService
{
private readonly Jokeservice jokeService { get; } = JokeService;
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
...
Page URL
https://learn.microsoft.com/en-us/dotnet/core/extensions/windows-service
Content source URL
https://github.com/dotnet/docs/blob/main/docs/core/extensions/windows-service.md
Document Version Independent Id
64d5cdf8-e50f-0c89-7f16-82645ba6383e
Article author
Metadata
- ID: ed148088-4550-2788-0756-390eab15e3f6
- Service: dotnet-fundamentals
IEvangelist
Metadata
Metadata
Assignees
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.dotnet-fundamentals/svcokr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.