public async Task<ActionResult> InspectionDetails(int id) { var sharePointToken = await AuthenticationHelper.GetAccessTokenAsync(AppSettings.DemoSiteServiceResourceId); var graphService = await AuthenticationHelper.GetGraphServiceAsync(AADAppSettings.GraphResourceUrl); Dashboard dashboardModel = new Dashboard(sharePointToken); var model = await dashboardModel.GetDashboardInspectionDetailsViewModelAsync(graphService, id, User.Identity.Name); if (model == null) return HttpNotFound(); var accessToken = await AuthenticationHelper.GetGraphAccessTokenAsync(); TempData["accesstoken"] = accessToken; await dashboardModel.CheckSubscriptionAsync(graphService, accessToken); return View(model); }
public async Task<ActionResult> InspectionDetails(int id) { var outlookToken = await AuthenticationHelper.GetAccessTokenAsync(AADAppSettings.OutlookResourceId); var sharePointToken = AuthenticationHelper.GetAccessTokenAsync(AppSettings.DemoSiteServiceResourceId); var graphService = AuthenticationHelper.GetGraphServiceAsync(); var oneNoteToken = AuthenticationHelper.GetOneNoteAccessTokenAsync(); var oneNoteServiceFactory = new OneNoteServiceFactory(AADAppSettings.OneNoteResourceUrl, await oneNoteToken); Dashboard dashboardModel = new Dashboard(await sharePointToken); var model = await dashboardModel.GetDashboardInspectionDetailsViewModelAsync(await graphService, oneNoteServiceFactory, id, User.Identity.Name); if (model == null) return HttpNotFound(); return View(model); }