I have a class definition in which a readonly member is defined.
private readonly Dictionary<string, string> map = new Dictionary<string, string>();
Now in order to test my design, I want to access this member outside its class definition. I was thinking of providing a get
method but unable to write an error free syntax.
Is it possible to assign value to a member(using new
) and still able to define its get
method?
PS: I am new to C# language.
EDIT: I have not written the code, its just a statement I have copied from an already written module. I have made some design changes in the module and want to test it with minimal changes possible in the code, so for that I was looking to get the readonly access of this member outside the class.