m31coding / M31.FluentAPI

Generate fluent builders for your C# classes with ease.
MIT License
94 stars 4 forks source link

Support params attribute #2

Closed vzam closed 5 months ago

vzam commented 6 months ago

Currently, when using FluentMethod with params, the params attribute is missing in the generated code. For example in public void UseThis(params string[] items), the generated code will only have string[] items as the parameter. See also ParamsArrayAttribute.

vzam commented 6 months ago

I think it should be considered to keep all attributes (except those from FluentApi itself) that were defined on the FluentMethod and maybe even FluentMember, as they could carry useful information. For example there is also the [StringFormatMethod("message")] attribute from JetBrains to give hints that a method accepts interpolated strings and enables the appropriate analyzers on the parameters.

m31coding commented 5 months ago

Thank you for this! I am going to fix it and test it with params as well as with other parameter modifiers. I am not sure yet about keeping all attributes. I would like to think more about the implications.