예제 #1
0
        public async Task <IEnumerable <PlanArmy> > GetArmies()
        {
            string armiesStringResponse = await ApiFramework.ApiGetStringResponse(Constants.ArmiesController);

            IEnumerable <PlanArmy> armies = JsonConvert.DeserializeObject <IEnumerable <PlanArmy> >(armiesStringResponse);

            return(armies);
        }
예제 #2
0
        public async Task <IEnumerable <PlanUnit> > GetArmyUnitsForArmy(Guid armyId)
        {
            string armyUnitUrlString    = $"{Constants.ArmyUnitsController}/planArmyId={armyId.ToString()}";
            string armiesStringResponse = await ApiFramework.ApiGetStringResponse(armyUnitUrlString);

            IEnumerable <PlanUnit> planUnits = JsonConvert.DeserializeObject <IEnumerable <PlanUnit> >(armiesStringResponse);

            return(planUnits);
        }