示例#1
0
        public IActionResult Create(Games games)
        {
            var game = _gameDataAccess.AddAsync(new Games()
            {
                Id               = ObjectId.GenerateNewId().ToString(),
                GameName         = games.GameName,
                GameLogo         = games.GameLogo,
                DuelBanner       = games.DuelBanner,
                TournamentBanner = games.TournamentBanner,
                Pc               = games.Pc,
                Mobile           = games.Mobile,
                Playstation      = games.Playstation,
                Xbox             = games.Xbox
            });

            if (game == null)
            {
                return(BadRequest(new { message = "Game eklenemedi!" }));
            }

            return(Ok(new { game.Result }));
        }