Skip to main content
1 of 3
Jodrell
  • 146
  • 6

As of c# 6.0, you should just do this,

public class Room
{
    public Room(Client client)
    {
        this.Client = client;
    }

    public Client Client { get; } = client;
}

public class Client
{
    public Client(long id)
    {
        this.Id = id;
    }

    public long Id { get; };
}

Raising a property of Client to Room is an obvious breach of encapsulation.

Jodrell
  • 146
  • 6