kiota
kiota copied to clipboard
C# models could be records
The models generated by Kiota for the Csharp lang are currently class
es. Making them record
s would enable the usage of with
among various benefits.
Would is be reasonable to do so?
Thanks for reaching out regarding this. The reason why we're not using records today is because the code kiota projects is netstandard2.0 so it supports the dotnet framework (4.X). There are a number of benefits we could unblock by switching to a netcore only support in the generated code, records as you outlined, but also the removal of a lot of conditional compilation and more. However changing this now would represent a breaking change, and require a new major version for kiota. It's unlikely we're going to be doing this now.
You should split your generators and have two projects: CSharp.Legacy and CSharp.Modern