Ejemplo n.º 1
0
        public async Task <bool> AddHighscore(Player player, int Highscore)
        {
            var temp = new Highscore();

            temp.InstertedDate = DateTimeOffset.Now;
            temp.PlayerId      = player.Id;
            temp.HighScore     = Highscore;

            await mindOfSpaceContext.Highscores.AddAsync(temp);

            return(await mindOfSpaceContext.SaveChangesAsync() > 0 ? true : false);
        }
Ejemplo n.º 2
0
        public async Task <bool> DeletePlayer(string username)
        {
            var temp = await GetPlayerByUsername(username);

            if (temp == null)
            {
                return(false);
            }

            var player = await GetPlayerByUsername(username);

            player.IsDeleted = true;

            mindOfSpaceContext.Update(player);

            return(await mindOfSpaceContext.SaveChangesAsync() > 0 ? true : false);
        }
Ejemplo n.º 3
0
        public async Task <bool> AddGame(Game game)
        {
            await mindOfSpaceContext.Games.AddAsync(game);

            return(await mindOfSpaceContext.SaveChangesAsync() > 0);
        }