// GET: HardDrives public async Task <IActionResult> Index() { string accessToken = await this.HttpContext.GetTokenAsync("access_token"); string response = await ApiRequests.GetAsync(accessToken, string.Format("{0}/{1}", this.apiBaseUrl, this.apiController)); List <HardDrive> hardDrive = JsonConvert.DeserializeObject <List <HardDrive> >(response); return(this.View(hardDrive)); }
// GET: RAMs/Edit/5 public async Task <IActionResult> Edit(Guid id) { string accessToken = await this.HttpContext.GetTokenAsync("access_token"); string response = await ApiRequests.GetAsync(accessToken, string.Format("{0}/{1}/{2}", this.apiBaseUrl, this.apiController, id)); RAM ram = JsonConvert.DeserializeObject <RAM>(response); return(this.View(ram)); }
// GET: CPUWatercooler/Details/5 public async Task <IActionResult> Details(Guid id) { string accessToken = await this.HttpContext.GetTokenAsync("access_token"); string response = await ApiRequests.GetAsync(accessToken, string.Format("{0}/{1}/{2}", this.apiBaseUrl, this.apiController, id)); CPUWatercooler cpuWatercooler = JsonConvert.DeserializeObject <CPUWatercooler>(response); return(this.View(cpuWatercooler)); }