codecentric / net_automatic_interface

.Net Source Generator for Automatic Interfaces
MIT License
60 stars 13 forks source link

Add support for `initial` keyword #44

Closed WizzardMaker closed 1 month ago

WizzardMaker commented 6 months ago

I'm using the initial keyword in some of my properties to limit the setting of them. This generator replaces initial with set, which is not the desired behaviour

Code:

public class X {
    public uint Id { get; init; }
}

Generated interface:

[GeneratedCode("AutomaticInterface", "")]
public partial interface IPlayer
{
    /// <inheritdoc />
    uint Id { get; set; }
}
ChristianSauer commented 1 month ago

Ok, can you give 4.1.0 a try?

ChristianSauer commented 1 month ago

Should be in 4.1.0