Skip to content
Discussion options

You must be logged in to vote

If the question is whether the primary constructor parameters can be reference types and if they can be mutated, the answer is yes, on both counts:

public class C(List<string> strings) {
    public void Add(string value) => strings.Add(value);
    public void Reset() => strings = new List<string>();
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Joebeazelman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants