예제 #1
0
        public IActionResult Secure()
        {
            var userName =
                HttpContext.User.Claims.FirstOrDefault(x => x.Type == $"{ClaimIdentifierConfiguration.ClaimsBaseUrl}{ClaimIdentifierConfiguration.DisplayName}");

            var viewmodel = new SecureViewModel {
                DisplayName = userName?.Value
            };

            return(View(viewmodel));
        }
예제 #2
0
        public async Task <IActionResult> Index()
        {
            var auth = User.GetAuth();

            var characterInfo = await esiClient.Character.GetCharacterPublicInfoV4Async(auth.CharacterId);

            var corporationInfo = await esiClient.Corporation.GetCorporationInfoV4Async(characterInfo.Model.CorporationId);

            var locationInfo = await esiClient.Location.GetCharacterLocationV1Async(auth);

            var location = await esiClient.Universe.GetSolarSystemInfoV4Async(locationInfo.Model.SolarSystemId);

            var model = new SecureViewModel
            {
                CharacterName     = characterInfo.Model.Name,
                CorporationName   = corporationInfo.Model.Name,
                CharacterLocation = location.Model.Name
            };

            return(View(model));
        }