public async Task <IActionResult> Detail(string id)
        {
            var result = await CacheAsync(() => _politicianService.GetPerson(id));

            var parsed = Newtonsoft.Json.JsonConvert.DeserializeObject <HlidacErrorMsg>(result);

            if (parsed.Valid == false)
            {
                return(NotFound(parsed.Error.Description));
            }

            return(Content(result, MediaTypeNames.Application.Json));
        }
Esempio n. 2
0
        public async Task <IActionResult> Detail(string id)
        {
            var result = CacheAsync(() => _politicianService.GetPerson(id));

            return(Content(await result, MediaTypeNames.Application.Json));
        }