Exemplo n.º 1
0
        public async Task <IActionResult> First()
        {
            var model = new FirstVm();

            using (var client = new HttpClient())
            {
                var result = await client.GetAsync("http://localhost:8050/api/Data/GetMetersWhereFaultValidationDate?id=1");

                var resultString = await result.Content.ReadAsStringAsync();

                var data = JsonConvert.DeserializeObject <List <ElectricityMeterDto> >(resultString);

                model.Items = data;
            }
            return(View(model));
        }
 public MainVm()
 {
     FirstViewModel    = new FirstVm();
     SecondViewModel   = new SecondVm();
     SelectedViewModel = this.FirstViewModel;
 }