dotnet-websharper / core

WebSharper - Full-stack, functional, reactive web apps and microservices in F# and C#
https://websharper.com
Apache License 2.0
598 stars 50 forks source link

Translate C# auto-properties the same as a field #1004

Open Jand42 opened 6 years ago

Jand42 commented 6 years ago

Currently, C# auto-implemented properties translate to a field with name $PropertyName (independent of Name attribute use), and both getter and setter is added as separate functions.

This is unnecessary bloat, it would be possible to just treat them the same as fields.

Extra concerns that need to be tested:

Jand42 commented 4 years ago

TypedJson.Serialize/Deserialize is currently not compatible between client/server because of this, so I am changing this to a bug. Workaround: convert to regular properties (e.g. with VS's "Convert to full property" lightbulb menu option)