Beispiel #1
0
        public ActionResult Assets(string id, bool isCorp, int characterId)
        {
            var key = _apiKeyRepository.GetById(id);
            if (null == key)
                return HttpNotFound();
            var api = new EveApi(key.keyId, key.vCode, characterId);
            var assets = isCorp ? api.GetCorporationAssets() : api.GetCharacterAssets();

            var summary = BuildLocationSummaries(assets);
            summary.Sort((a, b) => a.TotalValue < b.TotalValue ? 1 : a.TotalValue == b.TotalValue ? 0 : -1);

            var character = key.keyInfo.Characters.Single(i => i.CharacterID == characterId);
            return View(new AssetsViewModel()
            {
                Entity = isCorp ? character.CorporationName : character.Name,
                Assets = summary,
            });
        }