I am upgrading a .Net 4.8 project from ServiceStack 5.9.2 to 10.0.6 (still on .Net 4.8). The upgrade was mostly painless however changes to the CSharpGenerator causes a problem for me. I had 2 issues related to the collections and I was able to fix one but not the other.
The new code to initialize a collection uses C#12 syntax (e.g.: = new(); and = [];) which is not compatible with my .Net 4.8 project stuck on C#7.3
Do you have suggestion on how to fix this problem? I can manually fix the generated code using a regex search&replace but I would like to avoid manual steps that if possible.
Do you have InitializeCollections: True uncommented? because it should default to False in which case it wouldn’t generate the collection initializers.
Alternatively you could custom DTOs on the fly and doing the source code search/replace there by registering an implementation of INativeTypesFormatter in your IOC: