Property syntax looks like field access at the call site, but a property getter or setter executes accessor code on the receiver.
Inside a Controller method, selected refers to an existing Player with the JerseyNumber property defined in the linked lesson. Initially its backing field is 1.
If the underlying C# feature is unfamiliar, use the lesson below while reading this example.
selected.JerseyNumber = 7;
int displayedNumber = selected.JerseyNumber;The controller writes 7 through the player's JerseyNumber setter
The setter stores 7 in the backing field
After that completes, the controller invokes the getter
The getter returns 7
The caller stores it in displayedNumberUse these words to follow one execution before drawing it. Keep the same order and the same alternatives as the source; simplify the wording without adding work that the code does not perform.
controller : Controller and selected : Player in a Violet sequence diagram.set JerseyNumber(7) from controller to selected and show the setter activation ending before the next request. Its completion carries no value.get JerseyNumber() from controller to selected. Show its activation and a dashed result 7 back to the caller.Store 7 in displayedNumber. Explain that the accessor labels represent property syntax, not literal C# method names the student must type.Compare this reference with the diagram you built in Violet. Layout may differ; the source meaning, labels, and relevant connections should agree.
Both arrows target selected. The setter changes the backing field; the getter reads the updated value. No new Player is created by either access.