Creates an init property

    0

    2

    lucycodes42

    C# recipes

    The code defines a public property named Name. When the code is executed, the Name property gets access to the value assigned to it when the code is initialized. The Name property can also be accessed directly with the address of the property, which is automatically generated for you when you create a class.

    Shortcut: propinit

    public string Name { get; init; }
    
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.