A C# property gives controlled member access through get and set accessors. The class diagram should distinguish that public contract from its backing field.
This complete Player definition stores the value in a private field. The public property reads or writes that field without validation in this example.
public class Player
{
private int jerseyNumber;
public int JerseyNumber
{
get { return jerseyNumber; }
set { jerseyNumber = value; }
}
}Keep the stored jersey number in a private backing field
Expose a public JerseyNumber property
Its getter reads that field
Its setter writes the supplied value to that same field
Describe the property contract separately from its implementation storageThese words describe the class contract, not a sequence of runtime actions. Identify the types, stored members, operation inputs and results, and relationships before choosing compartments and connectors.
Player.-jerseyNumber : int.+JerseyNumber : int <<property>> {get; set;}. Preserve capitalization, annotation, and both listed accessors.<<property>> marks a C# property; {get; set;} lists its accessors. The annotations are text in this diagram, not extra methods to paste into C#.Compare this reference with the diagram you built in Violet. Layout may differ; the source meaning, labels, and relevant connections should agree.
JerseyNumber is not another independent stored count in this implementation. Both accessors use the same backing field.