public Task <Player> Create(NewPlayer player) { Player p = new Player(); p.Name = player.Name; p.Id = Guid.NewGuid(); p.CreationTime = DateTime.Now; return(repo.Create(p)); }
public async Task <Player> Create(NewPlayer newPlayer) { var player = new Player() { Id = Guid.NewGuid(), Name = newPlayer.Name, CreationTime = DateTime.UtcNow }; return(await _IRepo.CreatePlayer(player)); }
public async Task <Player> Create(NewPlayer player) { var rand = new Random(); Player asd = new Player(); asd.Name = player.Name; asd.Id = Guid.NewGuid(); asd.Score = rand.Next(999999); asd.Level = rand.Next(99); asd.IsBanned = false; DateTime now = DateTime.Now; asd.CreationTime = now; pellaaja.Add(asd); await _repository.Create(asd); return(asd); }
public Task <Player> Create([FromBody] NewPlayer player) { return(processor.Create(player)); }