Пример #1
0
        public IActionResult AddEnemy(int serialNumber, List <int> enemyId)
        {
            var clinker = _repo.Get(serialNumber);

            _repo.AddEnemy(serialNumber, enemyId[0]);

            return(Ok(clinker.Enemies));
        }
        public IActionResult UpdateClinkerEnemy(Guid clinkerId, Guid enemyId)
        {
            var repo = new ClinkerRepository();

            var clinkerThatGotUpdated = repo.AddEnemy(clinkerId, enemyId);

            return(Ok(clinkerThatGotUpdated));
        }
        public IActionResult AddEnemy(int id, int enemyId)
        {
            var usersExist = _repo.AddEnemy(id, enemyId);

            if (usersExist)
            {
                return(Created($"api/clinkers/{id}/add-enemy/{enemyId}", "Enemy successfully added"));
            }

            return(NotFound("Cannot add enemy as requested."));
        }
Пример #4
0
        public IActionResult AddClinkerToEnemiesList(Clinker enemyToAdd, int currentUserId)
        {
            var enemiesListPlusNewEnemy = _repository.AddEnemy(enemyToAdd, currentUserId);

            return(Ok(enemiesListPlusNewEnemy));
        }
Пример #5
0
        public IActionResult AddEnemy(int clinkerId, int enemyId)
        {
            var clinker = _repository.AddEnemy(clinkerId, enemyId);

            return(Ok(clinker));
        }