This cannot be done in C#. Any way to do it?
...
laugh, in case my little pun wasn\'t understood, what I mean is: how can I mark a property in C# as Non
You could probably do this with Mono.Cecil, a bytecode manipulation library. Theoretically, you could add custom attributes to the hidden backing field. This is so inconvenient, however, that I don't think it warrants an example.
If you had a large application with your own postprocessor, you might consider creating your own substitute for NonSerializedAttribute
that could be applied to properties. The postprocessor could then use Mono.Cecil or similar to apply NonSerializedAttribute
to the backing fields. It's quite common for large applications to undergo such postprocessing to save that extra bit of typing.