public async Task OnGetAsync() { string token = await idData.GetAccessToken(HttpContext); IEnumerable <Relation> rs = await client.GetAll(token); Data = rs.Select(x => new RelationsViewModel { Data = x }).ToArray(); Graph = new GraphViewModel { Graph = await RelationHelper.GenerateGraph(nodesClient, tagsClient, rs, token, await nodesClient.GetAll(token)) }; }
public async Task <IActionResult> OnPostQueryAsync() { string token = await idData.GetAccessToken(HttpContext); IEnumerable <Relation> ms = await client.Query(token, PostData.QueryId, PostData.QueryFrom, PostData.QueryTo); Data = ms.Select(x => new RelationsViewModel { Data = x }).ToArray(); Graph = new GraphViewModel { Graph = await RelationHelper.GenerateGraph(nodesClient, tagsClient, ms, token, await nodesClient.GetAll(token)) }; return(Page()); }