Ejemplo n.º 1
0
        public async Task <IResponse> AddArmyToBattleAsync(AddArmyCommand command)
        {
            Battle battle = await _battleRepository.GetByBattleId(command.BattleId);

            IResponse response = battle.AddArmy(new Army(command.Name, command.NumberOfUnits, command.StrategyAndAttackOption));

            if (!response.Success)
            {
                return(response);
            }

            await _unitOfWork.SaveChanges();

            return(response);
        }