public Player(PlayerRegistration registration) { Balance = 0M; UserName = registration.UserName; Password = registration.Password; Name = registration.Name; Address = registration.Address; City = registration.City; Country = registration.Country; PostCode = registration.PostCode; Verification = new Random().Next().ToString(); }
public Response Register(PlayerRegistration registration) { if (players.GetPlayers(registration.UserName).Any()) { return(new Response(false, "Duplicate user name")); } var newPlayer = new Player(registration); players.Add(newPlayer); return(new Response(true, "Player registered", newPlayer.Verification)); }