[Solved] Why does this code compile in one solution but not in another? [closed]

[ad_1]

This line …

private readonly List<Department> departments = new List<Department>();

… should not be in the function, but outside, at the class scope, or make it a var.

4

[ad_2]

solved Why does this code compile in one solution but not in another? [closed]