Skip to content

Implement property initializers for immutable types #229

@dsaf

Description

@dsaf

Immutable types are a best practice nowadays. However, when a C# class has a lot of properties it means ctor will have lots of parameters. Property initializers are easier to read and understand as well.
Can we have a way of initializing properties on immutable types? I have read about C# 6 auto-property initializers and unless I am mistaken they only help with compile-time constants.

PS: please don't do this by introducing new types (e.g. why have some sort of 'record' when we already have classes and structs?).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions