Short Version
In C++ I could do this...
const auto & help_id = help_type.functionHelpTypeId;
How can I do that in C#?
Long Version
How can I make one variable be a readonly alias for a class field or property in C#?
I have a method where I am making read-only aliases at the top of my function in order to make the rest of the code a little clearer and save some typing later.
var help_id = help_type.functionHelpTypeId;
var changeset_version = changeset.version;
var helpPageType = help_type.helpPageType;
// &ct.
My problem is that since these are not const, anyone could reassign them or mutate the objects they're referring to, which is not my intention. In order to know that these are just readonly aliases for class fields, one would basically have to study the whole function, which isn't ok.