You declared AccountContainer as struct . So
AccountList.Add(new AccountContainer("Michael", 54, 3, 512913));
creates a new instance of AccountContainer and adds a copy of this instance to the list; and
AccountList[0].Money = 547885;
extracts a copy of the first element in the list, changes the Money field of the copy and discards the copy - the first element in the list remains unchanged. Since this is clearly not what you intended, the compiler warns you about this.
Solution: do not create mutable struct s. Create an immutable struct (i.e., one that cannot be modified after its creation) or create a class .
source share