Skip to content

DEPRECATE FOR .NET 8 - USE PRIMARY CONSTRUCTORS #19

@burtonrodman

Description

@burtonrodman

With the introduction of primary constructors in .NET 8, this package will be deprecated.

Injected Services can now be defined tersely using primary constructor syntax:

public class TestService(
    IHttpContextAccessor accessor,
    IWidgetRepository widgetRepository,
    IOptions<EmailSenderOptions> emailSenderOptions)
{
}

Drawbacks (all minor, imho):

  • no null checking
  • no Options handling
  • fields are mutable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions