Exemplo n.º 1
0
        public async Task <ServiceResponse <Game> > Creategame(Game game, string password)
        {
            ServiceResponse <Game> serviceResponse = new ServiceResponse <Game>();

            try
            {
                // game.Id =Guid.Parse("-6c54s");
                //  Game oUser = await _gameRepository.GetSingle(game.Id);
                //   oUser.Name = game.Name;
                // oUser.ModifiedOn
                // game.ModifiedOn == ;
                //game.CreatedOn = DateTime.Now;
                //serviceResponse.Data = await _gameRepository.AddData(game);
                serviceResponse.Data = await _gameRepository.AddData(game);

                serviceResponse.Message = "Posh Game Created";
            }
            catch (Exception ex)
            {
                serviceResponse.IsSuccess = false;
                serviceResponse.Message   = ex.Message;
                _logger.LogError($"Something went wrong inside CreateSchedule action: {ex.Message}");
            }

            return(serviceResponse);
        }