Ok so let's say that I have a data container class
public class DataContainer {
public Person person;
}
and we already create an instance of this class
DataContainer dataContainer = new DataContainer();
dataContainer.Person = new Person("Smith");
and we try to pass it in a method that we want to be able to only read the container and not modified
public void ExampleMethod(in DataContainer dataContainer){
dataConainer.Person.name = "blablabla" //we don't want to be able to do that
dataContainer = new DataContainer(); // this is not possible because of in keyword
}
I tried the in keyword but it doesn't have any effect on prohibiting changes on container...
P.S. : convert the container into a struct is no solution because it will become immutable