コード例 #1
0
        async void updateEntities()
        {
            string gamesJson = await Requests.Get(ConstantSettings.GetGames);

            string studiosJson = await Requests.Get(ConstantSettings.GetStudios);

            string genresJson = await Requests.Get(ConstantSettings.GetGenres);

            string usersJson = await Requests.Get(ConstantSettings.GetUsers);

            List <Game>   games   = JsonConvert.DeserializeObject <List <Game> >(gamesJson);
            List <Studio> studios = JsonConvert.DeserializeObject <List <Studio> >(studiosJson);
            List <Genre>  genres  = JsonConvert.DeserializeObject <List <Genre> >(genresJson);
            List <User>   users   = JsonConvert.DeserializeObject <List <User> >(usersJson);


            List <GameView> gamesView = await EntityConverter.ToGamesView(games);

            List <StudioView> studiosView = EntityConverter.ToStudiosView(studios);
            List <GenreView>  genresView  = EntityConverter.TeGenresView(genres);
            List <UserView>   usersView   = EntityConverter.ToUsersView(users);


            dataGridGames.ItemsSource   = gamesView;
            dataGridStudios.ItemsSource = studiosView;
            dataGridGenres.ItemsSource  = genresView;
            dataGridUsers.ItemsSource   = usersView;
        }