public sealed class Player
public Player(string name, long score)
Id = Guid.NewGuid().ToString();
public string Name { get; private set; }
public string Id { get; private set; }
public long Score { get; private set; }
public sealed class PlayerDTO
public PlayerDTO(string name, long score, string id)
public string Name { get; private set; }
public string Id { get; private set; }
public long Score { get; private set; }
public static implicit operator PlayerDTO(Player player)
return new PlayerDTO(player.Name, player.Score, player.Id);
Action<PlayerDTO> print = p => Console.WriteLine("{0}'s score is {1}", p.Name, p.Score);
var player = new Player("Yan", 42);
PlayerDTO dto = new Player("Yan", 42);