예제 #1
0
        public ActionResult Index()
        {
            using (var client = new WebClient()) {
                try {
                    var obj        = client.DownloadString(APIUrl.TarefasAResolver(Convert.ToInt32(User.Identity.Name)));
                    var resolucoes = JsonConvert.DeserializeObject(obj, typeof(List <Interface.Resolucao>));

                    var viewModel = Mapper.Map <List <ResolucaoViewModel> >(resolucoes);

                    return(View(viewModel));
                } catch (WebException ex) {
                    ModelState.AddModelError(string.Empty, ex.Message);
                    return(View());
                }
            }
        }