C#: can you make it so that a method parameter passes an object by reference but is read-only?
eg:
void MyMethod(int x, int y, read-only MyObject obj)
where obj is an object reference but this object cannot be modified during the method.
obj
Can this be achieved in C#?
why don't you make a copy of that object and do whatever you want with that copy while your obj remains not modified.
See here how to clone your object: Deep cloning objects